fix: Avoid capacity leak or panic when a stream is cancelled after reserve_capacity#893
Merged
seanmonstar merged 1 commit intohyperium:masterfrom Apr 28, 2026
Conversation
47f487a to
03d67a4
Compare
03d67a4 to
e9efaba
Compare
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
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.