Files
container/Sources/Services/ContainerSandboxService/Client
Kathryn BaldaufandGitHub 10df89e0e6 Remove XPC timeout based on SIGTERM timeout in container stop (#1387)
`container stop` has an option `-t` for `Seconds to wait before killing
the containers` (see
[here](https://github.com/apple/container/blob/ce7736105747f48debb37ca1999b562b4bfae23c/Sources/ContainerCommands/Container/ContainerStop.swift#L39)).
This timeout is used to determine when the SandboxService should stop
waiting for the container to gracefully exit with `SIGTERM` (or another
provided signal) and send `SIGKILL`.

Today, we were setting the `SandboxService.stop` XPC call's timeout to
the value provided to `container stop -t` plus 1 second. This is
problematic in cases where the code flow to send SIGKILL to the
container then forcefully stop the VM does not complete within one
second of the SIGTERM timeout being hit. In those cases, we will return
that the XPC stop call failed due to hitting the timeout. In some cases
this may happen even though the container and VM have both been
successfully stopped.

This PR removes that XPC timeout for `SandboxService.stop` entirely. We
cannot reliably determine in the SandboxClient, which may be used by
third party runtime plugins to support additional container runtimes,
how long it may take for SIGKILL to kill the container and stop related
resources.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-04-03 19:04:43 -07:00
..