mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
When CreateSandbox or StartSandbox fails because the caller's context was canceled or ran past its deadline, cleanupShim passed that same context to ShutdownSandbox and derived the shim deletion timeout from it, so both failed at once and the shim, its sandbox and the mounts under its bundle were left behind. The cleanup now keeps the values of the caller's context but not its cancellation, and bounds the shutdown and the deletion with timeouts of their own; the shutdown one leaves the shim time to stop what it runs for the sandbox. A closed connection from a shim that exited before answering ShutdownSandbox is not logged as a failure, as Shutdown already treats it as success. Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>