#10155 fix: Correctly propagate SIGTERM to plugin subprocesses
Pull request opened by
edgarrmondragon
Description
Checklist
• I have read the
contribution guide
Was generative AI tooling used to co-author this PR?
• Yes (please specify the tool below)
Generated-by:
Claude Code (Fable) following
the agentic coding guidelines
Related Issues
•
meltano/sdk#3698
• Closes
#9981
• Supersedes
#9986
Summary by Sourcery
Handle SIGTERM in async jobs so plugin subprocesses can complete graceful shutdown and propagate correct exit codes to the CLI.
Bug Fixes:
• Ensure SIGTERM cancels running job tasks instead of exiting immediately so subprocess cleanup can complete.
• Return a consistent SIGTERM-derived exit code from job termination and surface it through the CLI when applicable.
Enhancements:
• Expose a helper to query whether a SIGTERM was received during job execution.
• Align error messaging for SIGTERM-triggered cancellations with other termination scenarios.
Tests:
• Extend job termination tests to cover async SIGTERM handling, task cancellation, and SIGTERM tracking state.
Summary by Sourcery
Improve SIGTERM handling so async jobs and the CLI propagate graceful termination and consistent exit codes while allowing plugin subprocess cleanup to complete.
New Features:
• Expose a helper to query whether a SIGTERM was received during job execution.
Bug Fixes:
• Ensure SIGTERM cancels the running job task instead of exiting immediately so plugin subprocesses can complete graceful shutdown.
• Propagate a consistent SIGTERM-derived exit code (143) from job termination through the CLI when applicable.
• Align error messaging for SIGTERM-triggered cancellations with other termination scenarios.
Tests:
• Extend job and CLI tests to cover async SIGTERM handling, task cancellation behaviour, SIGTERM tracking state, and exit code recording.
meltano/meltano