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

Handle for SIGTERM #561

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

Handle for SIGTERM #561

wants to merge 2 commits into from

Conversation

shayonj
Copy link

@shayonj shayonj commented Apr 29, 2024

In containerized workloads, it's common to receive a SIGTERM signal when a pod or task is shutting down. Currently, when this occurs, the rake task throws a SignalException and returns a status code of 1. This behavior can be misinterpreted by container orchestration systems (like Fargate, Kubernetes, etc.) as an error, rather than a graceful exit.

This PR proposes that, when a SIGTERM signal is received by a rake task, it should return an exit code of 143. This exit code is the standard response for a SIGTERM, indicating a proper shutdown was acknowledged and handled gracefully.

I only added this for SIGTERM, but should be extensive for other handlers too if needed in future.

Related: #272

@shayonj shayonj marked this pull request as ready for review April 29, 2024 20:29
@shayonj shayonj force-pushed the s/term-sginal branch 7 times, most recently from f4272ed to 581e40e Compare April 29, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant