manifests/07-downloads-deployment: Catch and exit on TERM#308
Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom Oct 4, 2019
Merged
Conversation
It's possible that this process would run as PID 1 in a PID namespace, and PID 1 has special handling [1]: Only signals for which the "init" process has established a signal handler can be sent to the "init" process by other members of the PID namespace. That's unlikely to be important for termination, because CRI-O will be TERMing the process from outside the pod's PID namespace. With the coming PID-namespace sharing [2], you could set this container process up to not be PID 1 in any namespace. But regardless, gracefully exiting when we're asked to is polite behavior. In the future, we might want to add something here to delay exiting until we have finished serving any ongoing downloads (or at least give them a fair shot at finishing), but clients can always retry any downloads that fail because our pod was killed, so I'm not worrying about that now. [1]: http://man7.org/linux/man-pages/man7/pid_namespaces.7.html [2]: https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/
4453714 to
7e8e4ef
Compare
Contributor
|
/lgtm I'll trust you on that! 😄😄 |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benjaminapetersen, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
/retest Please review the full test history for this PR and help us cut down flakes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's possible that this process would run as PID 1 in a PID namespace, and PID 1 has special handling:
That's unlikely to be important for termination, because CRI-O will be TERMing the process from outside the pod's PID namespace. With the coming PID-namespace sharing 2, you could set this container process
up to not be PID 1 in any namespace.
But regardless, gracefully exiting when we're asked to is polite behavior. In the future, we might want to add something here to delay exiting until we have finished serving any ongoing downloads (or at least give them a fair shot at finishing), but clients can always retry any downloads that fail because our pod was killed, so I'm not worrying about that now.