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

Add logging to layer retry code path #1281

Merged
merged 2 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.1 # Has fixes for stylecheck configuration https://github.com/golangci/golangci-lint/pull/2017/files
args: --timeout=5m -v
args: -v
only-new-issues: true

verify-main-vendor:
Expand Down
2 changes: 2 additions & 0 deletions internal/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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.