You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spec poststop hook behaviour is different from the popular implementations #1309
Hey. I was recently working on testing the hooks behaviour for youki and runc and noticed that the poststop hook behaviour described in the spec is different from what's actually implemented in these runtimes.
The poststop hooks MUST be invoked by the runtime. If any poststop hook fails, the runtime MUST log a warning, but the remaining hooks and lifecycle continue as if the hook had succeeded.
logging a warning does not change the flow of the operation; it MUST continue as if the warning had not been logged.
This contradicts the actual implementation, where if any poststop hook fails the subsequent hooks are not executed and the error is propagated to the caller.
This also contradicts the behaviour of the other hooks. Poststop is the only hook type with this "warn and continue" requirement. All other hooks (prestart, createRuntime, createContainer, startContainer, poststart) require generating an error on failure.
In my opinion it is better to adjust the specification for consistency with the existing implementations and the other hooks, because it will make it simpler and more intuitive.
Activity
fspv commentedon Feb 17, 2026
I've noticed that there was already a PR proposing a similar change #1265 (but it also suggested to add retries, which I don't suggest to do here).
Elthis commentedon Mar 18, 2026
It looks like crun implements it according to the spec and continues on poststop hook failures:
(poststop Hook Invocation ->
keep_goingset totrue)https://github.com/containers/crun/blob/53f31fdbb7950f1bc2bcb61acc59953a04d9e3c9/src/libcrun/container.c#L1799
(do_hooks -> when
keep_goingset totruethen just logs a warning and continues)https://github.com/containers/crun/blob/53f31fdbb7950f1bc2bcb61acc59953a04d9e3c9/src/libcrun/container.c#L827