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

implement TSTP handling #492

Merged
merged 1 commit into from Apr 16, 2018
Merged

Conversation

sideshowdave7
Copy link
Contributor

@sideshowdave7 sideshowdave7 commented Apr 13, 2018

Implements TSTP signal handler: Fixes #479

TSTP tells Shoryuken to "quiet" as it will be shutting down at some point in the near future. It will stop fetching new jobs but continue working on current jobs. Use TSTP + TERM to guarantee shutdown within a time period. Best practice is to send TSTP at the start of a deploy and TERM at the end of a deploy.

Note you still need to send TERM to actually exit the Shoryuken process.

Tests:

I tested against a shoryuken process with no active jobs and it behaved as expected.
I also tested sending some jobs to the shoryuken process and verified active ones were allowed to finish, and new jobs stopped being accepted.

I looked around and didn't see any spec tests for signals.

when 'TERM', 'INT'
logger.info { "Received #{sig}, will shutdown down" }
logger.info { "Received #{sig}, will shutdown" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍻

@phstc phstc merged commit ec92ebd into ruby-shoryuken:master Apr 16, 2018
@phstc
Copy link
Collaborator

phstc commented Apr 16, 2018

@sideshowdave7 thanks! Added to master 🍻

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.

None yet

2 participants