Repository navigation
Conversation
_pause_or_resume_reader called the callback before updating _reader_paused. A resume that synchronously crosses the high watermark asked to pause again while the flag still said paused, so the pause was dropped and the stream kept going.
Author
|
Closing this to narrow my open-source work to fewer projects. Anyone is welcome to pick the change up if it's useful. |
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.
Fixes #511.
_pause_or_resume_readercalled the pause/resume callback and only then stored_reader_paused. Resuming the reader can synchronously write enough to cross the high watermark and ask for a pause again. That nested call still saw the old flag, treated the pause as a no-op, and left the reader running. The output queue then overflows and the channel closes, which stalls a large streamed response.The flag is updated before the callback, and restored if the callback raises, so a failed callback does not leave the flag ahead of the reader.
Test plan
test_reentrant_resume_keeps_nested_pausetest_concurrent_pause_resume_race_conditiontest_flow_control_allow_multiple_pause_resume