fix: Avoid capacity leak or panic when a stream is cancelled after reserve_capacity#893
Merged
seanmonstar merged 1 commit intoApr 28, 2026
Conversation
ArniDagur
force-pushed
the
fix/no-panic-on-cancel-after-reserve
branch
2 times, most recently
from
April 28, 2026 01:49
47f487a to
03d67a4
Compare
ArniDagur
marked this pull request as draft
April 28, 2026 02:07
ArniDagur
force-pushed
the
fix/no-panic-on-cancel-after-reserve
branch
from
April 28, 2026 02:39
03d67a4 to
e9efaba
Compare
ArniDagur
marked this pull request as ready for review
April 28, 2026 02:44
seanmonstar
reviewed
Apr 28, 2026
| ); | ||
| // The stream may have been reset or closed since capacity was requested. | ||
| if !stream.state.is_send_streaming() && stream.buffered_send_data == 0 { | ||
| return; |
Member
There was a problem hiding this comment.
What do you think, worth a trace, or is it not interesting enough?
Contributor
Author
There was a problem hiding this comment.
I don't have a strong opinion here, but I lean towards not adding a trace.
- The existing guard for the same condition at another location does not log
- I'm not sure what the actionable item would be for someone that sees the log
seanmonstar
approved these changes
Apr 28, 2026
bmwill
added a commit
to MystenLabs/sui-rust-sdk
that referenced
this pull request
Jul 15, 2026
h2 versions before 0.4.14 have several stream-cancellation flow-control accounting bugs (hyperium/h2#893, #896, #897, #898, and #913, fixed across 0.4.14 and 0.4.15) that can permanently wedge a multiplexed gRPC connection: leaked connection send-window capacity, RST_STREAM frames that are never transmitted, and permanently missed `poll_capacity` wakeups. Add an explicit hyper 1.10 floor to sui-rpc (hyper 1.10 raised its h2 floor to 0.4.14 for the same reason) so downstream consumers cannot resolve a broken h2. The lockfile is not tracked in this repo, so the manifest floor is the durable guard.
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.
The following triggers a bug
In builds with debug assertions enabled, we panic:
In production builds, it instead leaks capacity, since the assert is compiled out.