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

Commit

Permalink
sandbox: Disconnect from agent after VM shutdown
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Evan Foster committed Aug 31, 2020
1 parent a1d993f commit 227cba6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,11 @@ func (s *Sandbox) Stop(force bool) error {
return err
}

// Stop communicating with the agent.
if err := s.agent.disconnect(); err != nil && !force {
return err
}

return nil
}

Expand Down

0 comments on commit 227cba6

Please sign in to comment.