Skip to content

Commit

Permalink
Merge pull request microsoft#1281 from dcantah/add-retrylayer-log
Browse files Browse the repository at this point in the history
Add logging to layer retry code path
  • Loading branch information
dcantah authored Jan 21, 2022
2 parents 6cee62b + f6bc864 commit afc692f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions layers/layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ func MountContainerLayers(ctx context.Context, containerID string, layerFolders
// for ERROR_NOT_READY as well.
if hcserr, ok := lErr.(*hcserror.HcsError); ok {
if hcserr.Err == windows.ERROR_NOT_READY || hcserr.Err == windows.ERROR_DEVICE_NOT_CONNECTED {
log.G(ctx).WithField("path", path).WithError(hcserr.Err).Warning("retrying layer operations after failure")

// Sleep for a little before a re-attempt. A probable cause for these issues in the first place is events not getting
// reported in time so might be good to give some time for things to "cool down" or get back to a known state.
time.Sleep(time.Millisecond * 100)
Expand Down

0 comments on commit afc692f

Please sign in to comment.