Skip to content

fix(util): preserve in-flight request state during unordered conversion#868

Open
Alpy16 wants to merge 1 commit into
tower-rs:masterfrom
Alpy16:fix-call-all-unordered
Open

fix(util): preserve in-flight request state during unordered conversion#868
Alpy16 wants to merge 1 commit into
tower-rs:masterfrom
Alpy16:fix-call-all-unordered

Conversation

@Alpy16
Copy link
Copy Markdown

@Alpy16 Alpy16 commented May 21, 2026

Description

This fixes a state-loss bug in CallAll::unordered.

CallAll can temporarily hold a request in curr_req after it has been pulled from the input stream but before it has been submitted to the inner service. Previously, converting a CallAll into CallAllUnordered rebuilt the unordered stream from only the service and stream, which discarded curr_req and reset other state.

Solution

  • Preserve the existing CallAll state when converting to CallAllUnordered.
  • Carry over curr_req and eof during the transition.
  • Replace the ordered queue with a fresh FuturesUnordered queue.
  • Add a regression test covering conversion while a request is in flight.

Fixes #860.

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.

util: CallAll::unordered() can silently drop a buffered request after a partial poll

1 participant