Skip to content

registry pull retries - #2443

Open
HarshwardhanPatil07 wants to merge 3 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:fix/ostree-registry-pull-retries
Open

HarshwardhanPatil07 wants to merge 3 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:fix/ostree-registry-pull-retries

Conversation

@HarshwardhanPatil07

Copy link
Copy Markdown
Member

What

Add bounded retries for registry-backed OSTree image pulls when the containers-image proxy reports a GetBlob request-initiation failure.

This also routes the normal, non-unified OSTree installation path through the shared retrying pull function.

Related: #2177

Why

CI has intermittently failed during commands such as bootc install to-filesystem when registries like Quay return transient errors, including 502 Bad Gateway and network timeouts.

The existing CI retry wrapper covers preparatory Podman operations, but it does not cover image pulls performed internally by bootc. Consequently, one temporary registry failure can fail the entire integration job.

Retries are appropriate here because registry availability is outside bootc's control and repeating an image pull is safe.

The proxy error does not expose the underlying HTTP status. Therefore, bootc cannot distinguish a transient 502 from every permanent GetBlob initiation failure. The retry count bounds the worst-case additional delay to 60 seconds.

@github-actions github-actions Bot added the area/install Issues related to `bootc install` label Sep 8, 2026
@bootc-bot
bootc-bot Bot requested a review from cgwalters September 8, 2026 09:44
Comment thread crates/lib/src/install.rs Outdated
Comment thread crates/lib/src/deploy.rs
Comment thread crates/lib/src/deploy.rs
Comment thread crates/lib/src/deploy.rs Outdated
Comment thread crates/lib/src/deploy.rs Outdated
Comment thread crates/lib/src/deploy.rs
Comment thread crates/lib/src/deploy.rs Outdated
Comment on lines +80 to +85
// Match the default attempt count and delay used by the Justfile's build-fetch
// retry helper. A failed attempt has to rebuild the importer, so retries are
// intentionally made at the whole-pull boundary instead of independently for
// every layer.
const PULL_MAX_ATTEMPTS: u32 = 3;
const PULL_RETRY_DELAY: Duration = Duration::from_secs(30);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Conceptually I think we should be matching what e.g. podman does by default. What our build system happens to do is a different unrelated thing.

On that topic see podman-container-tools/container-libs#951

In the short term, we can just copy the same defaults and add a link to that issue as a TODO to allow having bootc be configurable in the same way.

Comment thread crates/lib/src/deploy.rs Outdated
Comment thread crates/lib/src/install.rs Outdated
@github-actions github-actions Bot added the area/ostree Issues related to ostree label Sep 15, 2026
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the fix/ostree-registry-pull-retries branch 2 times, most recently from 1485745 to a2a0ced Compare September 15, 2026 11:36
Direct image pulls can fail when a registry transiently rejects the GetBlob request. Retry that narrowly classified failure at the whole-pull boundary with a bounded attempt count, while allowing non-registry and unrelated failures to return immediately.

Related: bootc-dev#2177

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the fix/ostree-registry-pull-retries branch from a2a0ced to 7bd3c43 Compare September 15, 2026 12:11
@HarshwardhanPatil07

Copy link
Copy Markdown
Member Author

PTAL @Johan-Liebert1 @cgwalters

Comment thread crates/lib/src/deploy.rs
Comment thread crates/lib/src/deploy.rs Outdated
Err(error) if retries < PULL_MAX_RETRIES && is_retryable_pull_error(&error) => {
let retry_delay = pull_retry_delay(retries);
let attempt = retries + 1;
tracing::warn!(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't currently have a ton of usage of warn!. I have a bit of a worry this is going to corrupt e.g. terminal progress rendering.

There's a kind of ongoing clash there between our usage of indicatif and tracing...we may need to do something tricky like hook into tracing and detect when indicatif is active and use that instead?

One thing we should perhaps do here is pass down the pull progress struct, and use that as our abstraction instead (yes this would be a much bigger task).


A general problem here is that we have no testing of our TUI progress rendering, because it's a bit tricky to do.

Did you test this out interactively? One good way to simulate pull failures is to e.g. inject iptables rules to reject packets to quay.io etc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Johan-Liebert1 helped me debugging this but we saw that progress bar was not rendering in first place with main branch

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.

Wait, no, I found the issue in my script. I didn't have -it in the podman command so the progress bar never showed up

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.

And I remember I had removed -it because the progress bar didn't render properly on my vim emulated terminal

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay, I tested this interactively by rejecting both IPv4 and IPv6 HTTPS traffic during a quay.io blob pull. The retry occurred and reused completed layers, but the captured progress output was not clean

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added a shared PullProgress abstraction

testing it manually it works, showed the retry message and preserved cached layers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you for recommending the e.g. to inject iptables rules

Comment thread crates/lib/src/install.rs
The non-unified installation path prepared and pulled images directly, bypassing the shared retry boundary and leaving bootc install to-filesystem exposed to transient registry failures. Route that path through the retrying pull while preserving unified-storage behavior.

Related: bootc-dev#2177

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the fix/ostree-registry-pull-retries branch from 7bd3c43 to 94cb1a5 Compare September 16, 2026 04:18
Share the pull progress renderer across attempts and print retry notices through indicatif so tracing output cannot interfere with active progress bars.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07
HarshwardhanPatil07 force-pushed the fix/ostree-registry-pull-retries branch from 496fb9a to 09be175 Compare September 16, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install Issues related to `bootc install` area/ostree Issues related to ostree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants