Skip to content

Move sigdump gem to global dependencies

Matthias Käppler requested to merge mk-sigdump-prod into master

What does this MR do and why?

In !81111 (merged) we added sigdump, a useful tool that traps SIGCONT (configurable) to dump several useful data to a tmpfile:

  • thread stack traces
  • object space dump
  • GC stats

This tool is useful for debugging live Rubies, so I think we should promote this to a global dependency. It is a small pure Ruby tool, and is summarized in a single file: https://github.com/fluent/sigdump/blob/master/lib/sigdump.rb My immediate use case outside of development was to debug Puma threads in a GKE cluster. In that environment we furthermore do not have access to rbtrace, which makes it difficult to inspect Ruby VM state.

I think it is safe to use in production, bar any clashes with signal handling, though I do not think we use CONT anywhere. For added safety, I moved it behind an ENV var.

Example: sigdump-7.log

Closes #363832 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Matthias Käppler

Merge request reports