Skip to content

Continue running poststop hooks after errors - #5561

Closed
sairex53 wants to merge 1 commit into
opencontainers:mainfrom
sairex53:5549-poststop-continue
Closed

sairex53 wants to merge 1 commit into
opencontainers:mainfrom
sairex53:5549-poststop-continue

Conversation

@sairex53

Copy link
Copy Markdown
Contributor

Fixes #5549.

OCI requires the runtime to run every poststop hook even if an earlier hook fails or times out. Hooks.Run currently returns after the first error, so later cleanup hooks never run.

Continue through the full poststop list and return all hook errors to the caller. Other hook types keep their current fail-fast behavior.

Tests verify that later poststop hooks run after failures, all failures remain discoverable with errors.Is, and prestart hooks still stop on the first error.

Validation:

  • go test ./libcontainer/configs -run "TestPoststopHooksRunAfterErrors|TestOtherHooksStopAfterError" -count=1
  • go test ./libcontainer -run TestStateStatus -count=1

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: you need to fix your commit message (to fit in the standard 80 columns).

otherwise LGTM

OCI requires the runtime to run every poststop hook, even if an earlier
hook fails. Keep the existing fail-fast behavior for all other hook types.

Fixes: opencontainers#5549
Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
@sairex53
sairex53 force-pushed the 5549-poststop-continue branch from bc2e290 to 9553b27 Compare October 19, 2026 02:08
@sairex53

Copy link
Copy Markdown
Contributor Author

nit: you need to fix your commit message (to fit in the standard 80 columns).

otherwise LGTM

Rewrapped the commit message to fit within 80 columns and pushed the updated commit, 9553b27.

@kolyshkin

Copy link
Copy Markdown
Contributor

Closing this PR because this account is engaged in PR farming (see moby/buildkit#7303 (comment) for details).

@sairex53 please do not contribute to this repo.

@kolyshkin kolyshkin closed this Oct 22, 2026
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.

runc stops the remaining poststop hooks after a hook fails or times out

2 participants