Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 227cba6

Browse files
author
Evan Foster
committed
sandbox: Disconnect from agent after VM shutdown
When a one-shot pod dies in CRI-O, the shimv2 process isn't killed until the pod is actually deleted, even though the VM is shut down. In this case, the shim appears to busyloop when attempting to talk to the (now dead) agent via VSOCK. To address this, we disconnect from the agent after the VM is shut down. This is especially catastrophic for one-shot pods that may persist for hours or days, but it also applies to any shimv2 pod where Kata is configured to use VSOCK for communication. Backport of kata-containers/kata-containers#556 to kata-containers/runtime master branch. See github.com/#2719 for details. Fixes #2719 Signed-off-by: Evan Foster <efoster@adobe.com>
1 parent a1d993f commit 227cba6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

virtcontainers/sandbox.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,11 @@ func (s *Sandbox) Stop(force bool) error {
16031603
return err
16041604
}
16051605

1606+
// Stop communicating with the agent.
1607+
if err := s.agent.disconnect(); err != nil && !force {
1608+
return err
1609+
}
1610+
16061611
return nil
16071612
}
16081613

0 commit comments

Comments
 (0)