summaryrefslogtreecommitdiffhomepage
path: root/runsc/cmd/checkpoint.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-11-05 15:34:24 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-05 15:36:20 -0800
commitc47f8afe2334c1395a2acd9ebf5191aa4554907c (patch)
tree10eccac0af9efe876167cf070396d0c6068c44ec /runsc/cmd/checkpoint.go
parentcaf1e52e18222d9eace348fa53e6857c78e15479 (diff)
Fix failure setting OOM score adjustment
When OOM score adjustment needs to be set, all the containers need to be loaded to find all containers that belong to the sandbox. However, each load signals the container to ensure it is still alive. OOM score adjustment is set during creation and deletion of every container, generating a flood of signals to all containers. The fix removes the signal check when it's not needed. There is also a race fetching OOM score adjustment value from the parent when the sandbox exits at the same time (the time it took to signal containers above made this window quite large). The fix is to store the original value in the sandbox state file and use it when the value needs to be restored. Also add more logging and made the existing ones more consistent to help with debugging. PiperOrigin-RevId: 340940799
Diffstat (limited to 'runsc/cmd/checkpoint.go')
-rw-r--r--runsc/cmd/checkpoint.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/runsc/cmd/checkpoint.go b/runsc/cmd/checkpoint.go
index d4e0da2ab..c0bc8f064 100644
--- a/runsc/cmd/checkpoint.go
+++ b/runsc/cmd/checkpoint.go
@@ -75,7 +75,7 @@ func (c *Checkpoint) Execute(_ context.Context, f *flag.FlagSet, args ...interfa
conf := args[0].(*config.Config)
waitStatus := args[1].(*syscall.WaitStatus)
- cont, err := container.Load(conf.RootDir, id)
+ cont, err := container.LoadAndCheck(conf.RootDir, id)
if err != nil {
Fatalf("loading container: %v", err)
}