Skip to content

cache: add retry_mode and retry_max_attempts options to s3 cache#6657

Merged
crazy-max merged 1 commit intomoby:masterfrom
jirimoravcik:feat-add-s3-retry-attrs
Apr 7, 2026
Merged

cache: add retry_mode and retry_max_attempts options to s3 cache#6657
crazy-max merged 1 commit intomoby:masterfrom
jirimoravcik:feat-add-s3-retry-attrs

Conversation

@jirimoravcik
Copy link
Copy Markdown
Contributor

This PR adds configurable retry behavior for the S3 cache.

Users can now set retry_mode (standard/adaptive) and retry_max_attempts to tune AWS SDK retry settings for their environment. When not specified, the AWS SDK defaults apply (standard mode, 3 max attempts).

Closes #6252

Left to discuss: I think it would be possible to allow passing in 0 as the number of attempts, which would translate to infinite retries, which doesn't feel that useful to me... but still worth considering.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds user-configurable AWS SDK retry behavior to the S3 remote cache backend, addressing the need to tune reliability in less-stable S3/S3-compatible environments (issue #6252).

Changes:

  • Document new S3 cache options retry_mode and retry_max_attempts.
  • Parse retry_mode / retry_max_attempts from cache attributes into the S3 cache config.
  • Apply the configured retry mode / max attempts when constructing the S3 client.

Reviewed changes

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

File Description
README.md Documents new S3 cache retry options (and includes minor formatting tweaks).
cache/remotecache/s3/s3.go Adds config fields + attribute parsing and applies retry settings to the S3 client options.

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

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread cache/remotecache/s3/s3.go
Comment thread cache/remotecache/s3/s3.go
Add configurable retry behavior for the S3 cache.
Users can now set `retry_mode` (standard/adaptive) and
`retry_max_attempts` to tune AWS SDK retry settings for their
environment. When not specified, the AWS SDK defaults apply
(standard mode, 3 max attempts).

Signed-off-by: Jiří Moravčík <jiri.moravcik@gmail.com>
@jirimoravcik jirimoravcik force-pushed the feat-add-s3-retry-attrs branch from 9e629ff to 2828e47 Compare April 6, 2026 21:23
@crazy-max
Copy link
Copy Markdown
Member

vlaidate-doctoc ci issue not related, fixed in #6660

@crazy-max
Copy link
Copy Markdown
Member

needs docs follow-up at https://docs.docker.com/build/cache/backends/s3/#synopsis (cc @dvdksn)

@crazy-max crazy-max merged commit 76eecc8 into moby:master Apr 7, 2026
278 of 281 checks passed
@crazy-max crazy-max added this to the v0.30.0 milestone Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure S3 cache retry behavior

4 participants