You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src: add --trace-sigterm to print a stack trace on SIGTERM
Neither `--report-on-signal` nor a `process.on('SIGTERM')` handler runs
while JavaScript is stuck, which is exactly when a trace is wanted: a
pod whose liveness probe stopped responding gets terminated with
SIGTERM, and there is currently no way to find out where it was stuck.
Print the stack trace from an interrupt instead, like `--trace-sigint`
does. The signal is watched through libuv on a dedicated thread and
event loop rather than through a signal handler of our own, so that it
stays multiplexed with `process.on('SIGTERM')` handlers: applications
that shut down gracefully are the ones most likely to have a handler
installed, and disabling the trace for them would defeat the purpose.
Watching the signal takes its default disposition away, so restore it
and re-raise once the trace has been printed, unless the application
handles SIGTERM itself, in which case libuv has already delivered the
signal to its handler as well.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes: #56879
Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
0 commit comments