Skip to content

Fix experimental queue metrics hanging with missing body size#6521

Merged
tewaro merged 1 commit intomainfrom
kruan/fix-experimental-queue-metrics-hang-missing-body-size
Apr 8, 2026
Merged

Fix experimental queue metrics hanging with missing body size#6521
tewaro merged 1 commit intomainfrom
kruan/fix-experimental-queue-metrics-hang-missing-body-size

Conversation

@tewaro
Copy link
Copy Markdown
Contributor

@tewaro tewaro commented Apr 8, 2026

No description provided.

@tewaro tewaro requested review from a team as code owners April 8, 2026 06:54
@tewaro tewaro requested a review from KennethRuan April 8, 2026 06:54
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Apr 8, 2026

The fix is consistent with existing patterns. The analysis is clear:

  1. The bug: kj::HttpClient::request() for GET without passing an expectedBodySize leaves the body stream open (since kj::none means "unknown body size"). The mock service in the test reads request.arrayBuffer(), which deadlocks because the body pipe never closes.
  2. The fix: Pass static_cast<uint64_t>(0) to signal that the GET request has zero body bytes, so the body pipe is immediately closed.
  3. The test: The test now reads the request body before responding, which matches production behavior and would have caught this hang.

This is a clean, correct, minimal fix. The pattern matches existing usage in r2-rpc.c++:121. The test properly validates the regression.

LGTM

github run

@tewaro tewaro enabled auto-merge April 8, 2026 07:39
@tewaro tewaro merged commit 1e952a5 into main Apr 8, 2026
25 of 26 checks passed
@tewaro tewaro deleted the kruan/fix-experimental-queue-metrics-hang-missing-body-size branch April 8, 2026 07:40
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