Skip to content

Commit bd3dd40

Browse files
committed
runtime: fail when a poststop hook fails
If a poststop hook run failed(maybe because the resource is still not ready to be recycled), we expect that the delete operation could fail and be retried util all poststop hooks run succeed. Signed-off-by: f00589305 <[email protected]>
1 parent 7017384 commit bd3dd40

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: config.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#ru
634634

635635
### <a name="configHooksPoststop" />Poststop
636636

637-
The `poststop` hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns.
637+
The `poststop` hooks MUST be called [after the user-specified process is killed](runtime.md#lifecycle), but before the [`delete`](runtime.md#delete) operation return.
638+
Runtime should make sure that if a `poststop` hook failed, the [`delete`](runtime.md#delete) operation could fail and be retried.
638639
Cleanup or debugging functions are examples of such a hook.
639640

640641
The `poststop` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).

Diff for: runtime.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The lifecycle describes the timeline of events that happen from when a container
7676
11. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container.
7777
12. The container MUST be destroyed by undoing the steps performed during create phase (step 2).
7878
13. The [`poststop` hooks](config.md#poststop) MUST be invoked by the runtime.
79-
If any `poststop` hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded.
79+
If any `poststop` hook fails, the runtime MUST [generate an error](#errors), so that the Runtime's [`delete`](runtime.md#delete) command fails and retry is required until all `poststop` hooks succeed.
8080

8181
## <a name="runtimeErrors" />Errors
8282

0 commit comments

Comments
 (0)