Repository navigation
remotes/docker: handle context cancellation in pushWriter.Commit - #14359
Open
DARSHANR007 wants to merge 1 commit into
Open
DARSHANR007 wants to merge 1 commit into
DARSHANR007 wants to merge 1 commit into
Conversation
When pushing an image, pushWriter.Commit waits on the registry response without checking ctx.Done(). If the client cancels the operation or the request times out, Commit hangs until the TCP connection drops. Add a ctx.Done() check to the select block so we exit promptly on cancellation or timeout. Also ensure any received response body is drained and closed properly so http.Client can reuse the connection. Signed-off-by: darsh <[email protected]>
DARSHANR007
force-pushed
the
docker-pusher-context-cancellation
branch
from
October 14, 2026 05:52
f7d5cf4 to
bae2ace
Compare
Author
|
/retest |
|
@DARSHANR007: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
DARSHANR007
force-pushed
the
docker-pusher-context-cancellation
branch
from
October 14, 2026 07:33
00a0fdc to
bae2ace
Compare
This was referenced Oct 14, 2026
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
When pushing an image layer,
pushWriter.Commit()waits on registry response channels without checkingctx.Done(). If the context is canceled or times out,Commit()hangs indefinitely until the connection drops.This change:
case <-ctx.Done():check topushWriter.Commit()to returnctx.Err()promptly on cancellation or timeout.pw.Close()to abort active background pipes.resp.Body(viaio.Copy(io.Discard, resp.Body)) sohttp.Clientcan reuse keep-alive connections.Fixes #14358