Skip to content

manifests/07-downloads-deployment: Catch and exit on TERM#308

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
wking:downloads-term-handler
Oct 4, 2019
Merged

manifests/07-downloads-deployment: Catch and exit on TERM#308
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
wking:downloads-term-handler

Conversation

@wking
Copy link
Copy Markdown
Member

@wking wking commented Oct 3, 2019

It's possible that this process would run as PID 1 in a PID namespace, and PID 1 has special handling:

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.

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 3, 2019
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/
@wking wking force-pushed the downloads-term-handler branch from 4453714 to 7e8e4ef Compare October 3, 2019 20:59
@benjaminapetersen
Copy link
Copy Markdown
Contributor

/lgtm

I'll trust you on that! 😄😄

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2019
@openshift-ci-robot
Copy link
Copy Markdown
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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 4, 2019
@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 6f5aca3 into openshift:master Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants