Print threads backtrace on SIGINFO/SIGPWR#1830
Print threads backtrace on SIGINFO/SIGPWR#1830sobrinho wants to merge 8 commits intocucumber:mainfrom
Conversation
|
Ignore any failing tests in CI for the CCK |
|
This has CI failures related to this code. I'm currently knee-deep in investigating / fixing up other areas of the main codebase so won't be able to dive into this much in the next 1-2 weeks |
|
@luke-hill fixed |
|
Failures are not related to this PR. |
|
@luke-hill would you fire the workflows again? Updated with main. |
|
The failures are on Just give me a small amount of time to get back to you on this. |
|
Hi @sobrinho All of the existing issues I needed to fix are now done. I've asked copilot to give this a quick review. Once that's all done I'll give it one last review and endeavour to merge this and release v11 |
There was a problem hiding this comment.
Pull request overview
Adds a signal handler to the Cucumber CLI to dump all threads’ backtraces to the error stream when receiving SIGINFO (macOS) or SIGPWR (Linux), to help debug stuck builds.
Changes:
- Register a SIGINFO/SIGPWR trap during
Cucumber::Cli::Main#execute!to print a per-thread backtrace dump to@err. - Add a CLI spec that triggers the signal and asserts a backtrace line is emitted.
- Document the new behavior in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/cucumber/cli/main.rb | Adds trap_thread_dump_signal and hooks it into execute! to print thread backtraces on SIGINFO/SIGPWR. |
| spec/cucumber/cli/main_spec.rb | Adds a spec that sends SIGINFO/SIGPWR to self and verifies a backtrace dump is written to stderr. |
| CHANGELOG.md | Adds an “Unreleased” changelog entry for the new thread-dump-on-signal behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@sobrinho if you're able to get this fixed up reviews wise and CI wise in the next few days I can commit to merge this and deploying this into v11. WDYT? |
|
@luke-hill fixed! |
Description
Debugging stuck builds is always tricky and this will add a thread backtrace dump to STDERR when the process is signaled with SIGINFO (macOS) or SIGPWR (linux).
On macOS you can use CTRL+T to signal the running process. Linux you can use
kill -PWR pid.I have a PR open against RSpec as well here.
This is a common pattern used by Sidekiq and Puma that I'm aware of but possibly other projects as well.
Type of change
Please delete options that are not relevant.
Please add an entry to the relevant section of CHANGELOG.md as part of this pull request.
Checklist:
Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.
bundle exec rubocopreports no offenses