Skip to content

Wait for container exit before forcing handler#41341

Merged
AkihiroSuda merged 1 commit intomoby:masterfrom
cpuguy83:fix_exit_event_race
Aug 13, 2020
Merged

Wait for container exit before forcing handler#41341
AkihiroSuda merged 1 commit intomoby:masterfrom
cpuguy83:fix_exit_event_race

Conversation

@cpuguy83
Copy link
Copy Markdown
Member

This code assumes that we missed an exit event since the container is
still marked as running in Docker but attempts to signal the process in
containerd returns a "process not found" error.

There is a case where the event wasn't missed, just that it hasn't been
processed yet.

This change tries to work around that possibility by waiting to see if
the container is eventually marked as stopped. It uses the container's
configured stop timeout for this.

Fixes #41338

This code assumes that we missed an exit event since the container is
still marked as running in Docker but attempts to signal the process in
containerd returns a "process not found" error.

There is a case where the event wasn't missed, just that it hasn't been
processed yet.

This change tries to work around that possibility by waiting to see if
the container is eventually marked as stopped. It uses the container's
configured stop timeout for this.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Copy Markdown
Member

@tonistiigi PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestDockerDaemonSuite/TestDaemonRestartUnlessStopped (again)

3 participants