Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exitcode/timestamp consistency after checkpoint creation/restore #9388

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libpod/container_internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,9 @@ func (c *Container) checkpoint(ctx context.Context, options ContainerCheckpointO
logrus.Debugf("Checkpointed container %s", c.ID())

if !options.KeepRunning && !options.PreCheckPoint {
c.state.State = define.ContainerStateStopped
if err := c.waitForExitFileAndSync(); err != nil {
return err
}

// Cleanup Storage and Network
if err := c.cleanup(ctx); err != nil {
Expand All @@ -1102,7 +1104,6 @@ func (c *Container) checkpoint(ctx context.Context, options ContainerCheckpointO
}
}

c.state.FinishedTime = time.Now()
return c.save()
}

Expand Down Expand Up @@ -1326,6 +1327,9 @@ func (c *Container) restore(ctx context.Context, options ContainerCheckpointOpti
logrus.Debugf("Restored container %s", c.ID())

c.state.State = define.ContainerStateRunning
c.state.ExitCode = 0
c.state.FinishedTime = time.Time{}
c.state.StartedTime = time.Now()

if !options.Keep {
// Delete all checkpoint related files. At this point, in theory, all files
Expand Down