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

Support for retry? #147

Closed
vsoch opened this issue May 14, 2022 · 6 comments · Fixed by #398
Closed

Support for retry? #147

vsoch opened this issue May 14, 2022 · 6 comments · Fixed by #398
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vsoch
Copy link

vsoch commented May 14, 2022

hey oras developers!

I've been using oras in CI, and I typically need to wrap it in some kind of retry with exponential backoff. To compare to another registry client, when I use docker it will retry pulling blobs, and same with Singularity. How could it work? I suspect there could be some Retry-After header returned from a server, and if not, the user could specify a number of retries. Would this be something oras could support? In practice I have seen a lot of push failures in my CI when using oras, and probably just the fault of the receiving end.

@shizhMSFT shizhMSFT added the enhancement New feature or request label May 16, 2022
@shizhMSFT
Copy link
Contributor

shizhMSFT commented May 16, 2022

Thanks for mentioning the retry. The retry functionality is planned after the release of v2 as an enhancement.

Retrying seems to be a simple feature, but it is not. There are two levels of retry: HTTP level retry and application level retry.

  • HTTP Level: Not all requests are retriable. Only GET and HEAD requests can be retried. Retrying PUT/PATCH/POST requests is problematic. For uploading the blob, the POST request is retriable but PATCH and PUT are not.
  • Application Level: The retry logic is at the application side as the application as more context on the operation (e.g. blob upload). For instance, the retry logic is in the dockerd code based and is not in the registry client.

We will probably add retry logic in the remote package but before that, we need to have a proper design first.

@shizhMSFT shizhMSFT added this to the future milestone May 16, 2022
@vsoch
Copy link
Author

vsoch commented May 16, 2022

Excellent! And yes of course a good design goes without saying.

@shizhMSFT shizhMSFT modified the milestones: future, v2.0.0 Jun 28, 2022
@souleb
Copy link
Contributor

souleb commented Jun 30, 2022

@shizhMSFT I am interested in implementing the retry logic in the remote pkg. What is the process to propose a design?

@FeynmanZhou
Copy link
Member

@shizhMSFT I am interested in implementing the retry logic in the remote pkg. What is the process to propose a design?

@souleb Thanks for your interest! ORAS community is open to any kind of proposal and design. Now you can create a discussion to add your proposal.

Going forward, we will create a separate folder to store the proposal docs and template. What do you think of it?

@souleb
Copy link
Contributor

souleb commented Jun 30, 2022

Great! Thanks.

@shizhMSFT
Copy link
Contributor

Discussed in #232

@shizhMSFT shizhMSFT modified the milestones: v2.0.0-rc.2, v2.0.0 Jul 27, 2022
@shizhMSFT shizhMSFT moved this to In Progress in ORAS-Planning Aug 2, 2022
@yizha1 yizha1 modified the milestones: v2.0.0-rc.3, v2.0.0-rc.4 Aug 23, 2022
Wwwsylvia pushed a commit that referenced this issue Jan 17, 2023
If implemented, this will provide a default http client with retry.

The retry function is an exponential back off 0.25s * 2^n ± 10% and max
5 attempts.

The client is the default client of `auth.Client`

BREAKING CHANGE: `auth.DefaultClient` uses `retry.DefaultClient` instead of `http.DefaultClient`
Fixes: #147 
Co-authored-by: Shiwei Zhang <[email protected]>
Signed-off-by: Soule BA <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress to Done in ORAS-Planning Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants