Repository navigation
runsc: fix start of a sub-container in a restoring sandbox - #16744
Merged
EtiennePerot merged 3 commits intoDec 1, 2026
Merged
EtiennePerot merged 3 commits into
EtiennePerot merged 3 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
jingyugao
force-pushed
the
fix/start-subcontainer-nil-restore-reply
branch
from
October 30, 2026 16:05
f56dbf6 to
2398b6e
Compare
jingyugao
added a commit
to jingyugao/gvisor
that referenced
this pull request
Oct 31, 2026
|
hit this independently on release-20261102.0 with plain runsc (no containerd), repro in #16945 |
shayonj
reviewed
Nov 25, 2026
Member
|
Also, please check out the recently updated contributor guidelines around DCO. Thanks! |
jingyugao
force-pushed
the
fix/start-subcontainer-nil-restore-reply
branch
from
November 25, 2026 14:22
2398b6e to
4cfa07a
Compare
ayushr2
reviewed
Nov 25, 2026
Contributor
|
@jingyugao thanks for the fix, can you rebase? |
StartSubcontainer translates `runsc start` on a restoring sandbox to RestoreSubcontainer, and passes a nil reply. Since a49825f added RestoreReply, RestoreSubcontainer writes to that reply, so the translated call panics with a nil pointer dereference and the sandbox exits. Pass the reply through and return it to the caller. The caller needs it: when this start restores the last container, the sandbox must switch from its lifecycle CPU limit to the application CPU limit. Otherwise the application keeps running under the higher lifecycle limit. Signed-off-by: gaojingyu <[email protected]>
A subcontainer can retain the CPU limit that was in effect when it was created. When its start or restore starts the restored kernel, apply the current application limit under the root container's state-file lock to serialize the change with runsc update. Exercise both paths by updating the root quota after creating the subcontainer and checking cpu.max after restore completes. Signed-off-by: gaojingyu <[email protected]>
jingyugao
force-pushed
the
fix/start-subcontainer-nil-restore-reply
branch
from
November 30, 2026 02:00
7b25196 to
9ec43b5
Compare
ayushr2
reviewed
Nov 30, 2026
EtiennePerot
previously approved these changes
Nov 30, 2026
EtiennePerot
enabled auto-merge (squash)
November 30, 2026 20:05
shayonj
previously approved these changes
Nov 30, 2026
Signed-off-by: gaojingyu <[email protected]>
auto-merge was automatically disabled
December 1, 2026 05:19
Head branch was pushed to by a user without write access
EtiennePerot
approved these changes
Dec 1, 2026
EtiennePerot
enabled auto-merge (squash)
December 1, 2026 05:44
nybidari
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StartSubcontainertranslatesrunsc starton a restoring sandbox toRestoreSubcontainer(e7b87ed) and passes a nil reply. Since a49825f addedRestoreReply,RestoreSubcontainerwritesreply.KernelStarted, so the translated call panics and the sandbox exits:The caller sees
urpc method "containerManager.StartSubcontainer" failed: EOF: the sandbox exited before the container started.Change
StartSubcontainernow passes its reply through and returns it toSandbox.StartSubcontainer.Avoiding the panic alone is not enough. When this start restores the last container, the sandbox has to switch from the lifecycle CPU limit to the application CPU limit, and only the reply tells the caller that this happened. Without it, the application keeps running under the higher lifecycle limit. The caller now applies the limit in the same way as
Sandbox.RestoreSubcontainer.Testing
Added
TestMultiContainerCheckpointRestoreStartSubcontainer. It restores the root container, callsStarton the sub-container, and then checks that the sub-container works and thatcpu.maxholds the application limit.EOFcpu.maxis100000 100000, want25000 100000I ran this test and
TestMultiContainerCheckpointRestorelocally on the KVM platform only, because Systrap fails on my WSL2 host (failed to install seccomp notify rules: device or resource busy).nogopasses forrunsc/boot,runsc/sandboxand therunsc/containertests. I hit the panic on a Kubernetes node running Systrap, where this path is reached by a pod restore.🤖 Generated with Claude Code
https://claude.ai/code/session_01CXi3Tj8W2ypHic4RL4MAwa