Skip to content

Commit

Permalink
add hotfix back
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi committed Dec 4, 2024
1 parent 5b54136 commit 35df058
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/worker/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,21 @@ func (s *Worker) spawn(request *types.ContainerRequest, spec *specs.Spec, output

// Handle checkpoint creation & restore if applicable
if s.IsCRIUAvailable() && request.CheckpointEnabled {
restored, _, err := s.attemptCheckpointOrRestore(ctx, request, consoleWriter, startedChan, configPath)
restored, restoredContainerId, err := s.attemptCheckpointOrRestore(ctx, request, consoleWriter, startedChan, configPath)
if err != nil {
log.Printf("<%s> - C/R failed: %v\n", containerId, err)
}

if restored {
// HOTFIX: If we restored from a checkpoint, we need to use the container ID of the restored container
// instead of the original container ID
containerInstance, exists := s.containerInstances.Get(request.ContainerId)
if exists {
containerInstance.Id = restoredContainerId
s.containerInstances.Set(containerId, containerInstance)
containerId = restoredContainerId
}

exitCode = s.waitForRestoredContainer(ctx, containerId, startedChan, outputChan, request, spec)
return
}
Expand Down

0 comments on commit 35df058

Please sign in to comment.