Skip to content

Commit

Permalink
only display living async tasks when sigdumping
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Nov 10, 2023
1 parent 9757f94 commit 78b94cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/stackdump
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
set -e
kubetruth_pid=$(ps ax | grep '[k]ubetruth' | awk '{print $1}')
kill -CONT "${kubetruth_pid}"
sleep 1
cat /tmp/sigdump-${kubetruth_pid}.log
rm -f /tmp/sigdump-${kubetruth_pid}.log
1 change: 1 addition & 0 deletions lib/kubetruth/sigdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def dump_backtrace(thread, io)
original_dump_backtrace(thread, io)

ObjectSpace.each_object(Async::Task) do |task|
next unless task.alive?
dump_async(task, io) if task
end

Expand Down

0 comments on commit 78b94cd

Please sign in to comment.