libct: fix restored container status on init exit - #5374
Open
l46983284-cpu wants to merge 1 commit into
Open
Conversation
l46983284-cpu
force-pushed
the
5370-restored-state-exit
branch
from
July 28, 2026 20:04
be54390 to
71bf3db
Compare
Author
|
Follow-up for the CI residual: restore now sets |
kolyshkin
reviewed
Jul 29, 2026
Comment on lines
+298
to
+301
| // TestRestoredStatusRequiresInitStartTime covers the checkpoint CI residual of #5370: | ||
| // after the restoredState.transition fix, Status() correctly leaves restoredState when | ||
| // !hasInit(). Restore must therefore set initProcessStartTime (as create does) so a | ||
| // live restored process still reports Running. |
Contributor
There was a problem hiding this comment.
This description better suits the commit message. From the perspective of someone reading the code a few years later, they are not very aware of various minor fixes that were made.
I think we can drop this test and squash the rest of the second commit into the first one.
kolyshkin
reviewed
Jul 29, 2026
| container := &Container{ | ||
| id: "restored-status", | ||
| config: &configs.Config{}, | ||
| cgroupManager: &mockCgroupManager{ |
restoredState.transition accepted stopped/running without assigning c.state, so refreshState left a restored container stuck reporting Running after its init process exited. With transition now updating c.state, Status()/refreshState correctly leave restoredState when init is gone. Restore must then also assign initProcessStartTime after updateState, matching create; otherwise hasInit() is false for a live restored process and checkpoint tests see stopped immediately (CI residual of opencontainers#5370). Fixes opencontainers#5370 Signed-off-by: Alex Chen <l46983284@gmail.com>
l46983284-cpu
force-pushed
the
5370-restored-state-exit
branch
from
July 29, 2026 19:37
71bf3db to
0e171a9
Compare
Author
|
Done — dropped the test, squashed everything into a single commit, and moved the rationale into the commit message. Also good timing on #5382 then. |
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.
Fixes #5370.
restoredState.transitionacceptedstopped/runningwithout assigningc.state, sorefreshStateleft a restored container stuck reportingRunningafter its init process exited.With
transitionnow updatingc.state,Status()/refreshStatecorrectly leaverestoredStatewhen init is gone. Restore must then also assigninitProcessStartTimeafterupdateState, matching create; otherwisehasInit()is false for a live restored process and checkpoint tests seestoppedimmediately.Adds unit tests covering the transition state assignment for restored and running containers.