Skip to content

fix: preserve collected data when controller script is interrupted by signal#671

Merged
harp-intel merged 1 commit intomainfrom
fix/preserve-flamegraph-data-on-sigint
Mar 25, 2026
Merged

fix: preserve collected data when controller script is interrupted by signal#671
harp-intel merged 1 commit intomainfrom
fix/preserve-flamegraph-data-on-sigint

Conversation

@harp-intel
Copy link
Contributor

Summary

  • When SIGINT is sent during flamegraph/telemetry collection on a remote target, the controller script handles the signal gracefully and outputs all collected data before exiting with code 0
  • However, perfspect's signal handler then sends SIGINT to its child SSH process, causing SSH to return exit code 255 instead of relaying the controller's exit code
  • Previously, any non-zero controller exit code caused all collected data to be discarded
  • Now, when the exit code is non-zero but stdout contains valid controller output (the <----------------------> delimiter from print_summary), the data is parsed and returned with a warning instead of being treated as a fatal error

Test plan

  • Run flamegraph collection on a remote target and send SIGINT during collection — verify output files are generated
  • Run flamegraph collection normally (no SIGINT) — verify no change in behavior
  • Run make test — all unit tests pass

🤖 Generated with Claude Code

… signal

When SIGINT is sent during flamegraph (or telemetry) collection, the
controller script handles it gracefully and outputs collected data before
exiting. However, the SSH process carrying the output gets interrupted by
perfspect's signal handler, returning exit code 255. Previously this
caused all collected data to be discarded.

Now, when the controller exit code is non-zero but stdout contains valid
controller output, the data is parsed and returned instead of being
treated as a fatal error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@harp-intel harp-intel merged commit 0a312ac into main Mar 25, 2026
5 checks passed
@harp-intel harp-intel deleted the fix/preserve-flamegraph-data-on-sigint branch March 25, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant