Skip to content

Correctly capture return code from run-helper.sh after receiving a SIGTERM or SIGINT #3788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sberss
Copy link

@sberss sberss commented Apr 3, 2025

There is a subtle bug in the run.sh script when using runWithManualTrap. When a SIGINT or SIGTERM is sent, the wait command will be interrupted, causing the return code to be set to 143. It then does its subsequent checks on the incorrect return code, so if run-helper.sh did exit with a return code of 2, the process would not be restarted.

This fix introduces a signaled flag to track when the trap was run. In such cases, the wait will simply be run again.

@sberss sberss requested a review from a team as a code owner April 3, 2025 20:52
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.

2 participants