Skip to content
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

Ensure signals are passed to commands (#3548) #3558

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

thisisnotashwin
Copy link
Contributor

  • Ensure signals are passed to commands

Change /bin/sh -ec "<command>" to
/bin/sh -ec "exec <command>". Adding exec ensures that <command> is not executed as a child process but replaces the /bin/sh process. This ensure that <command> receives any signals.

Specifically this is an issue when attempting to trap SIGTERMs as part of graceful pod shutdown. Without this change, we weren't receiving any signals because they aren't passed down by /bin/sh -c.

  • Fix broken bats tests and add changelog

Changes proposed in this PR

How I've tested this PR

How I expect reviewers to test this PR

Checklist

* Ensure signals are passed to commands

Change `/bin/sh -ec "<command>"` to
`/bin/sh -ec "exec <command>"`. Adding `exec` ensures that `<command>`
is not executed as a child process but replaces the `/bin/sh` process.
This ensure that `<command>` receives any signals.

Specifically this is an issue when attempting to trap SIGTERMs as part
of graceful pod shutdown. Without this change, we weren't receiving any
signals because they aren't passed down by `/bin/sh -c`.

* Fix broken bats tests and add changelog

Signed-off-by: Ashwin Venkatesh <[email protected]>

---------

Signed-off-by: Ashwin Venkatesh <[email protected]>
Co-authored-by: Ashwin Venkatesh <[email protected]>
@thisisnotashwin thisisnotashwin added the pr/no-backport signals that a PR will not contain a backport label label Feb 6, 2024
@thisisnotashwin
Copy link
Contributor Author

Closes #3554

@thisisnotashwin thisisnotashwin merged commit f053e43 into release/1.2.x Feb 6, 2024
29 of 49 checks passed
@thisisnotashwin thisisnotashwin deleted the luke/1.2.x-ensure-signals branch February 6, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport signals that a PR will not contain a backport label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants