From 330223b31a5daa44345017c6640e28d7ce00658b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 10 Dec 2015 20:36:48 -0800 Subject: [PATCH] runtime-config: Require serial hook execution Extend [1,2,3] to avoid: hook 1: spawn ---------------> reaped hook 2: spawn ----------------> reaped hook 3: spawn -----> reaped and explicitly require: hook 1: spawn --> reaped hook 2: spawn --> reaped hook 3: spawn --> reaped Folks who do want parallel execution are free to use a parallelizing wrapper: hook 1: spawn ---------------------------> reaped child 1 -----> reaped child 2 ---------> reaped child 3 ---> reaped Although that cuts both ways (with parallel hooks, folks could always use a single hook with a serializing wrapper). Still, I'd guess most current implementations are already taking the serialized approach, so it makes bundle-author life easier if we are explicit about that. [1]: https://github.com/opencontainers/specs/issues/20#issuecomment-138347849 [2]: https://github.com/opencontainers/specs/pull/156 [3]: https://github.com/opencontainers/specs/pull/157 Signed-off-by: W. Trevor King --- runtime-config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime-config.md b/runtime-config.md index a02a08bea..23924c3df 100644 --- a/runtime-config.md +++ b/runtime-config.md @@ -10,7 +10,7 @@ Presently there are `Prestart`, `Poststart` and `Poststop`. * [`Poststop`](#poststop) is a list of hooks to be run after the container process exits Hooks allow one to run code before/after various lifecycle events of the container. -Hooks MUST be called in the listed order. +Hooks MUST be called in the listed order, with each hook process being reaped before the next hook is executed. The state of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work. Hook paths are absolute and are executed from the host's filesystem.