GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(oci): retry transient token requests by abhinavgautam01 · Pull Request #281 · git-pkgs/proxy

Conversation

@abhinavgautam01

@abhinavgautam01 abhinavgautam01 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #266.

  • Retry OCI Bearer-token requests after transient network and DNS failures.
  • Retry rate-limited (429) and server-error (5xx) token responses.
  • Use bounded exponential backoff: 500ms, 1s and 2s.
  • Respect request cancellation and deadlines while waiting to retry.
  • Avoid retrying permanent token failures such as invalid credentials (401).
  • Add regression coverage for temporary DNS failures and permanent authentication failures.

Validation

  • gofmt
  • go tool golangci-lint run ./...
  • go vet ./...
  • go test -race ./...
  • git diff --check

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@abhinavgautam01
fix(oci): retry transient token requests
e770099
@andrew
andrew requested a lite review from Copilot August 22, 2026 08:58
Copilot started reviewing on behalf of andrew August 22, 2026 08:59
View session
Copilot AI reviewed Aug 22, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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 improves OCI/Docker registry authentication robustness by adding retry logic around bearer-token acquisition, aiming to mitigate transient network/DNS failures and certain retryable HTTP responses, with accompanying regression tests.

Changes:

  • Add bounded exponential backoff retries for token fetch on transient request failures and on 429 / 5xx responses.
  • Refactor token response handling into helpers (decodeTokenResponse, tokenResponseError) and add retry decision helpers.
  • Add tests covering temporary DNS failures (retry) and permanent auth failures (no retry).

Reviewed changes

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

File Description
internal/httpclient/transport.go Implements token-request retry loop with backoff, plus helper functions for decoding/errors and retry decisions.
internal/httpclient/transport_test.go Adds regression tests verifying retries on temporary DNS failures and no retries on 401 responses.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/httpclient/transport.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/httpclient/transport_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@abhinavgautam01
fix(oci): tighten token retry handling
094f609
andrew
andrew requested changes Aug 24, 2026
View reviewed changes

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please add regression tests for the new 429/5xx response retries, the four-attempt limit, the 500ms, 1s, and 2s delay sequence through the injected waiter, and cancellation while waiting. Current coverage exercises temporary DNS errors and permanent failures. The HTTP-status and bounded-backoff paths remain untested.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@abhinavgautam01
test(oci): cover token request retries
bb7ac44
@abhinavgautam01

abhinavgautam01 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, added regression coverage for 429/5xx retries, the four-attempt limit, the injected 500ms/1s/2s backoff sequence and cancellation while waiting.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andrew
andrew approved these changes Aug 25, 2026
View reviewed changes

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The retry policy and production OCI authentication path look correct. The latest commit covers the requested status, attempt-limit, backoff, and cancellation cases.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrew
andrew merged commit f0d90cd into git-pkgs:main Aug 25, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@andrew andrew andrew approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add a Docker Hub authentication retry loop for Docker

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@abhinavgautam01 @andrew
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.