Skip to content

Conversation

@ryuichi1208
Copy link

@ryuichi1208 ryuichi1208 commented Nov 15, 2025

Fix signal name display in worker termination logs

Previously, when a worker process was terminated by a signal like SIGABRT,the log would display "Worker (pid:X) was sent code 134!" instead of the actual signal name. This happened because the code incorrectly interpreted shell exit codes (128 + signal_number) as signal numbers.

Changes:

  • Use os.WIFSIGNALED() and os.WTERMSIG() to correctly detect and extract
    signal numbers from process exit status
  • Use os.WIFEXITED() and os.WEXITSTATUS() to correctly extract exit codes
  • Handle shell convention where exit code > 128 indicates signal termination
    (e.g., 134 = 128 + SIGABRT)
  • Add tests for both direct signal termination and shell-style exit codes

After this fix, the log correctly displays:
"Worker (pid:X) was sent SIGABRT!" instead of "Worker (pid:X) was sent code 134!"

Fixes signal name logging for all signals including SIGABRT, SIGKILL, SIGTERM, etc.

issue: #3434

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