Skip to content

fix: Avoid timeouts when pushing to a registry - #511

Open
dragosgheorghioiu wants to merge 1 commit into
prod-stagingfrom
dragosg/fix/registry-push-timeout
Open

dragosgheorghioiu wants to merge 1 commit into
prod-stagingfrom
dragosg/fix/registry-push-timeout

Conversation

@dragosgheorghioiu

Copy link
Copy Markdown
Contributor

unikraft image build --output <ref> fails when pushing a large rootfs: a ~2 GB blob PUT dies 30s in.

This adds a dedicated HTTP client for container-registry traffic with no response-header timeout, so a registry may take as long as it needs to commit a large blob.

Comment thread internal/httpclient/httpclient.go Outdated
@jedevc

jedevc commented Sep 21, 2026

Copy link
Copy Markdown
Member

馃 what kind of ref?

This does feel odd to me, ResponseHeaderTimeout is after the request is fully written. It takes 30s to write after all the data is there?

See https://github.com/containerd/containerd/blob/574a60700ee870807a052e2a0d0c7eed08b7ce8f/core/remotes/docker/registry.go#L254-L269, for the containerd default transport... which defaults to 30s.

@craciunoiuc craciunoiuc 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.

Just one more important comment

Comment thread internal/httpclient/httpclient.go Outdated
Comment thread internal/httpclient/httpclient.go Outdated
Comment thread internal/httpclient/httpclient_test.go Outdated
Signed-off-by: Dragos Gheorghioiu <dragosg@unikraft.com>
@dragosgheorghioiu
dragosgheorghioiu force-pushed the dragosg/fix/registry-push-timeout branch from bfceb68 to 1f282fa Compare September 22, 2026 06:04
@dragosgheorghioiu

Copy link
Copy Markdown
Contributor Author

馃 what kind of ref?

This does feel odd to me, ResponseHeaderTimeout is after the request is fully written. It takes 30s to write after all the data is there?

See https://github.com/containerd/containerd/blob/574a60700ee870807a052e2a0d0c7eed08b7ce8f/core/remotes/docker/registry.go#L254-L269, for the containerd default transport... which defaults to 30s.

For a 2.5G image pushed to harbor:

FROM --platform=linux/x86_64 alpine:3.20 AS build

RUN dd if=/dev/urandom of=/big.bin bs=1M count=2560

FROM scratch

COPY --from=build /big.bin /big.bin
COPY --from=build /bin/busybox /bin/sh

You get this http2: timeout awaiting response headers so it seems it does take more than 30 seconds to respond after the data is there. It basically fails when committing the layers.
It may be the case that is just harbor being slow. Pushing to local registries doesn't have this problem.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants