Skip to content

resolver: retry on transient network errors#13323

Merged
AkihiroSuda merged 1 commit into
containerd:mainfrom
dmcgowan:resolver-transient-errors
Jun 13, 2026
Merged

resolver: retry on transient network errors#13323
AkihiroSuda merged 1 commit into
containerd:mainfrom
dmcgowan:resolver-transient-errors

Conversation

@dmcgowan

Copy link
Copy Markdown
Member

Allow the last host to retry on transient network errors to incrase the likelihood of the operation succeeding and help reduce flaky tests.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds transport-level retry logic to the Docker resolver so that transient network/transport failures (e.g., timeouts/EOFs) can be retried on the last registry host, improving resiliency and reducing test flakiness.

Changes:

  • Introduces a shared attempt budget (maxAttempts) and adds doWithTransportRetries / isTransientTransportErr to retry transient transport errors.
  • Updates resolver retry flow to route all request attempts through the shared attempt budget.
  • Adds unit tests for transient error classification and transport retry behavior; updates existing fetcher tests to align with the new attempt limit.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
core/remotes/docker/resolver.go Adds transient transport retry logic and a shared max-attempts budget integrated into request retry flow.
core/remotes/docker/resolver_test.go Adds unit tests for transient error detection and doWithTransportRetries behavior.
core/remotes/docker/fetcher_test.go Updates expectations to use the new shared maxAttempts budget.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/remotes/docker/resolver_test.go Outdated
Comment thread core/remotes/docker/resolver.go Outdated
Comment thread core/remotes/docker/resolver.go
Comment thread core/remotes/docker/resolver.go Outdated
@dmcgowan
dmcgowan force-pushed the resolver-transient-errors branch from a86132d to dcb6c10 Compare May 1, 2026 00:19
@dmcgowan dmcgowan added this to the 2.4 milestone May 4, 2026
@dmcgowan dmcgowan moved this from Needs Triage to Needs Reviewers in Pull Request Review May 4, 2026
@dmcgowan
dmcgowan marked this pull request as ready for review May 4, 2026 20:56
Copilot AI review requested due to automatic review settings May 4, 2026 20:56
@dosubot dosubot Bot added area/distribution Image Distribution kind/enhancement labels May 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/remotes/docker/resolver.go
Comment thread core/remotes/docker/resolver.go Outdated
Comment thread core/remotes/docker/resolver.go Outdated

@prakleumas prakleumas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beep boop
Hello! I am @samuelkarp's friendly code review robot 🤖! Sam asked me to take a look and post my comments directly on GitHub.

Please treat my comments as suggestions and advisory, not mandates. Since I am an LLM and my output is used here directly, you should evaluate carefully and see if my suggestions make sense. Feel free to directly resolve any you disagree with.

This is not an automated action. This bot does not read or reply to comments.

Comment thread core/remotes/docker/resolver.go
Comment thread core/remotes/docker/resolver.go Outdated
Comment thread core/remotes/docker/resolver_test.go Outdated
Comment thread core/remotes/docker/resolver.go Outdated
Comment thread core/remotes/docker/resolver_test.go Outdated
Comment thread core/remotes/docker/resolver.go Outdated
Comment thread core/remotes/docker/resolver_test.go Outdated

@samuelkarp samuelkarp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly seems fine to me. The one Copilot comment about the last 50ms sleep at a final failure seems worth addressing, everything else seems optional.

@dmcgowan dmcgowan moved this from Needs Reviewers to Review In Progress in Pull Request Review Jun 12, 2026
@dmcgowan dmcgowan added the cherry-pick/2.3.x Change to be cherry picked to release/2.3 label Jun 12, 2026
@dmcgowan
dmcgowan force-pushed the resolver-transient-errors branch from dcb6c10 to fdd3049 Compare June 12, 2026 22:04
Copilot AI review requested due to automatic review settings June 12, 2026 23:28
@dmcgowan
dmcgowan force-pushed the resolver-transient-errors branch from fdd3049 to 1f7ac8c Compare June 12, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread core/remotes/docker/resolver.go Outdated
Allow the last host to retry on transient network errors to incrase the
likelihood of the operation succeeding and help reduce flaky tests.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan
dmcgowan force-pushed the resolver-transient-errors branch from 1f7ac8c to 20af2e3 Compare June 12, 2026 23:36
@AkihiroSuda
AkihiroSuda added this pull request to the merge queue Jun 13, 2026
@AkihiroSuda

Copy link
Copy Markdown
Member

/cherry-pick release/2.3

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@AkihiroSuda: once the present PR merges, I will cherry-pick it on top of release/2.3 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release/2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Merged via the queue into containerd:main with commit 06c38dc Jun 13, 2026
84 of 88 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jun 13, 2026
@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@AkihiroSuda: new pull request created: #13591

Details

In response to this:

/cherry-pick release/2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dmcgowan dmcgowan added cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch and removed cherry-pick/2.3.x Change to be cherry picked to release/2.3 labels Jun 29, 2026
@dmcgowan
dmcgowan deleted the resolver-transient-errors branch July 6, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/distribution Image Distribution cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch kind/enhancement size/L

Projects

Development

Successfully merging this pull request may close these issues.

8 participants