From 10df89e0e6add6b63d81d8eb9672260b2af4e04b Mon Sep 17 00:00:00 2001 From: Kathryn Baldauf Date: Fri, 3 Apr 2026 19:04:43 -0700 Subject: [PATCH] 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 --- .../ContainerSandboxService/Client/SandboxClient.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/Services/ContainerSandboxService/Client/SandboxClient.swift b/Sources/Services/ContainerSandboxService/Client/SandboxClient.swift index 6f1cdd2d..6723c6ae 100644 --- a/Sources/Services/ContainerSandboxService/Client/SandboxClient.swift +++ b/Sources/Services/ContainerSandboxService/Client/SandboxClient.swift @@ -176,9 +176,8 @@ extension SandboxClient { let data = try JSONEncoder().encode(options) request.set(key: SandboxKeys.stopOptions.rawValue, value: data) - let responseTimeout = Duration(.seconds(Int64(options.timeoutInSeconds + 1))) do { - try await self.client.send(request, responseTimeout: responseTimeout) + try await self.client.send(request) } catch { throw ContainerizationError( .internalError,