-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine RequestBody delegate, source state to fix hang #666
Conversation
…to single state Fixes issue with hang where yield was told to stop producing and but then was told it could continue producing before the next call to yield.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one performance remark here.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #666 +/- ##
==========================================
+ Coverage 83.69% 83.77% +0.07%
==========================================
Files 116 116
Lines 7276 7339 +63
==========================================
+ Hits 6090 6148 +58
- Misses 1186 1191 +5 ☔ View full report in Codecov by Sentry. |
…roject#666) * Combine RequestBody delegate produceMore and waiting continuations into single state Fixes issue with hang where yield was told to stop producing and but then was told it could continue producing before the next call to yield. * Attempt to remove withCheckedContinuation for produceMore state * Avoid allocating deque if only one continuation is created * Update codecov token * Resume all continuations on produceMore
The waitingForProduceMore continuations and the produceMore state have been combined into one state in the Delegate of RequestBody,
Fixes issue with hang where yield was told to stop producing and but then was told it could continue producing before the next call to yield.
An alternative solution, which is simpler, would be to wait on the continuation as soon as
yield
returnsstopProducing
but this meansSource.yield()
stalls on the yield that returns stop producing and not the next yield.