Description
In pkg/unikontainers/utils.go, executeHook() only sets a context
timeout when hook.Timeout is explicitly set in the OCI spec:
if hook.Timeout != nil && *hook.Timeout > 0 {
ctx, cancel = context.WithTimeout(...)
}
The OCI spec defines Timeout as optional (*int, omitempty).
When absent, context.Background() is used — which never cancels.
A hook process that hangs forever will block executeHooksConcurrently()
because wg.Wait() never returns, errChan never closes, and
for err := range errChan blocks forever. The container never starts
and no error or warning is logged.
The comment on line 312 says "otherwise use global config timeout"
but no global timeout is implemented in UruncConfig.
System info
- Urunc version: 0.7.0-154fc9e
- Arch: x86_64
- VMM: any
- Unikernel: any
Steps to reproduce
- Define a container with a hook that has no
timeout field set
- Make the hook process hang indefinitely (e.g.
sleep infinity)
- Observe urunc never completes
Exec() with no error logged
Note
This issue was identified during a code review of the hook execution
path. The code path has been manually verified by the contributor.
Description
In
pkg/unikontainers/utils.go,executeHook()only sets a contexttimeout when
hook.Timeoutis explicitly set in the OCI spec:The OCI spec defines
Timeoutas optional (*int,omitempty).When absent,
context.Background()is used — which never cancels.A hook process that hangs forever will block
executeHooksConcurrently()because
wg.Wait()never returns,errChannever closes, andfor err := range errChanblocks forever. The container never startsand no error or warning is logged.
The comment on line 312 says "otherwise use global config timeout"
but no global timeout is implemented in
UruncConfig.System info
Steps to reproduce
timeoutfield setsleep infinity)Exec()with no error loggedNote
This issue was identified during a code review of the hook execution
path. The code path has been manually verified by the contributor.