Skip to content

[release/1.3] Make killing shims more resilient#4307

Merged
dmcgowan merged 1 commit intocontainerd:release/1.3from
fuweid:cp-1_3-4204
Jun 16, 2020
Merged

[release/1.3] Make killing shims more resilient#4307
dmcgowan merged 1 commit intocontainerd:release/1.3from
fuweid:cp-1_3-4204

Conversation

@fuweid
Copy link
Copy Markdown
Member

@fuweid fuweid commented Jun 5, 2020

Currently, we send a single SIGKILL to the shim process
once and then we spin in a loop where we use kill(pid, 0)
to detect when the pid has disappeared completely.

Unfortunately, this has a race condition since pids can be reused causing us
to spin in an infinite loop when that happens.

This adds a timeout to this loop which logs a warning and exits the
infinite loop.

Signed-off-by: Ashray Jain ashrayj@palantir.com
(cherry picked from commit 3e95727)
Signed-off-by: Wei Fu fuweid89@gmail.com


cherry-pick: #4204

Not sure that it is good to do cherry-pick 4204. If not and we recommend user to use shim v2, I will close it. :)

cc @ashrayjain

Currently, we send a single SIGKILL to the shim process
once and then we spin in a loop where we use kill(pid, 0)
to detect when the pid has disappeared completely.

Unfortunately, this has a race condition since pids can be reused causing us
to spin in an infinite loop when that happens.

This adds a timeout to this loop which logs a warning and exits the
infinite loop.

Signed-off-by: Ashray Jain <ashrayj@palantir.com>
(cherry picked from commit 3e95727)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jun 5, 2020

Build succeeded.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit cc54652 into containerd:release/1.3 Jun 16, 2020
@fuweid fuweid deleted the cp-1_3-4204 branch June 18, 2020 02:43
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.

5 participants