Repository navigation
fix(rust): clean up pending requests on cancellation - #566
Merged
Connor Peet (connor4312) merged 1 commit intoNov 6, 2026
Merged
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: e58983b66a4340038f1e6ef1a2852f6a
Paolo Tranquilli (redsun82)
requested review from
Connor Peet (connor4312) and
roblourens
as code owners
November 5, 2026 10:13
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the Rust request-cancellation cleanup change.
No open issues 🎉
What changed in this PR
Fixes Rust client pending-request leaks when callers drop or abort request futures, addressing #565 without changing the wire protocol or existing timeout and error behavior.
Changes:
- Adds a drop guard and synchronous pending-map locking so cancellation cleans up entries, including while outbound admission is blocked.
- Adds regression tests for cancellation, late replies, continued client usability, error handling, and response/shutdown races.
- Adds a Rust-only changelog fragment.
| File | Description |
|---|---|
docs/.changes/20261105-rust-request-cancellation-cleanup.json |
Records the cancellation cleanup fix for Rust consumers. |
clients/rust/crates/ahp/src/client/tests.rs |
Tests pending-entry cleanup and preserved client behavior. |
clients/rust/crates/ahp/src/client.rs |
Adds drop-based cleanup and updates pending-map locking. |
Review effort: Balanced
Connor Peet (connor4312)
enabled auto-merge (squash)
November 5, 2026 16:31
Vritant Bhardwaj (vritant24)
approved these changes
Nov 5, 2026
Dileep Yavanmandha (dileepyavan)
approved these changes
Nov 6, 2026
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.
Dropping a Rust request future leaves its pending entry behind when the peer stays silent. Use an RAII guard to remove the entry synchronously, including while outbound admission is blocked, without changing timeout/error behavior or the wire protocol.
Regression tests cover cancellation, continued client usability, late replies, and response/shutdown races. All 87 client tests/doctests pass.
Overlaps with the pending-request cleanup in #490; this isolates that fix from the broader lifecycle changes.
Closes #565