Skip to content

Conversation

@k0s-bot
Copy link
Contributor

@k0s-bot k0s-bot commented Nov 19, 2025

Automated backport to release-1.34, triggered by a label in #6630.
See .

The test's server handler used to loop on writes. Once the client
canceled the download, the next write hit a broken pipe and failed the
test intermittently:

- The handler kept looping: write chunk, check request context, short
  sleep, repeat.
- When the test client canceled, the HTTP stack closed the TCP
  connection immediately.
- The handler only noticed cancellation after the select ran, but there
  was a race between the next write and the select.
- If Go scheduled the loop so that it hit another write before the
  select observed the request context being done, that write ran against
  a half-closed socket and returned broken pipe.

The handler now writes once, flushes to let the client see the written
data, waits for the request context being done, and asserts that the
request context was canceled, hence it will never write more than once.

Fixes: 1a54f6c ("Implement cancellation of stale downloads")
Signed-off-by: Tom Wieczorek <[email protected]>
(cherry picked from commit c6577d7)
@k0s-bot k0s-bot requested review from a team as code owners November 19, 2025 13:07
@k0s-bot k0s-bot requested review from jnummelin and twz123 November 19, 2025 13:07
@twz123 twz123 added bug Something isn't working area/ci backport/release-1.33 PR that needs to be backported/cherrypicked to the release-1.33 branch labels Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci backport/release-1.33 PR that needs to be backported/cherrypicked to the release-1.33 branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants