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

Fix sigterm-forwarding #54

Merged
merged 2 commits into from
Aug 19, 2016
Merged

Fix sigterm-forwarding #54

merged 2 commits into from
Aug 19, 2016

Conversation

d-sparks
Copy link
Contributor

Previously, what was happening was that the SIGTERM was being forwarded
from gearcmd to its entire process group, which sent a second, uncaught
sigterm to gearcmd.

@d-sparks
Copy link
Contributor Author

I updated the unit test to actually test the functionality, and also tested manually by building a local copy, connecting it to my local gearman, running jobs and killing the gearcmd PID and verifying that its child process's sigterm handling kicks in.

@johnhuangclever
Copy link
Contributor

I remember adding this back in the day (right after I joined Clever) and I dug up the original ticket that caused this change to be made:
https://clever.atlassian.net/browse/SCHOOLS-22?focusedCommentId=34890&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-34890

I think we will have to change gaprov-worker's bash script to forward the sigterm properly before we merge this change in.

@d-sparks
Copy link
Contributor Author

@johnhuangclever That's not necessary, gaprov-worker doesn't use --pass-sigterm.

// be sent first folloed by SIGKILL after the grace period is over. If the grace period is 0, this
// is simply a hard SIGKILL.
func stopProcess(p *os.Process, gracePeriod time.Duration) error {
lg.InfoD("killing-pid", logger.M{"pgid": p.Pid})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't call this pgid, instead call it pid.

@natebrennand
Copy link
Contributor

LGTM after the log is fixed

Previously, what was happening was that the SIGTERM was being forwarded
from gearcmd to its entire process group, which sent a second, uncaught
sigterm to gearcmd.
@d-sparks d-sparks merged commit 3a629d4 into master Aug 19, 2016
@d-sparks d-sparks deleted the fix-sigterm-forwarding branch August 19, 2016 20:13
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

3 participants