-
Notifications
You must be signed in to change notification settings - Fork 656
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
Fix NIOAsyncSequenceProducer
watermark strategy.
#2952
Conversation
4aba8e4
to
1fe8490
Compare
# Motivation It was currently possible that the producer's delegate is getting called twice with `produceMore` even if no `yield` returned a `stopProducing`. This could happen when we expected the producer to yield elements but the consumer went below the low watermark again. Resulting in two subsequent calls. # Modification This PR stores the current demand state in the strategy which let's us avoid flipping the `hasOustandingDemand` state of the sequence. # Result Correctly, ensured the call order of `produceMore` and `stopProducing`.
1fe8490
to
ff1408c
Compare
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.
Looks good!
@rnro hi, not sure who to mention here but you approved changes here so maybe it is you. My question is how soon a new release with this changes merged can be expected? |
We are unlikely to release before next week at the absolute earliest. However, if we released today our |
@Lukasa thanks, thats an unexpected (for me) turn, but next week as an optimistic release date is great nevertheless. Won't pretend to understand fully the issue you mentioned, but since it concerns those who use swift 6, can't the changes in this issue be wrapped with |
This issue isn't the one that's affected, the issue is a number of other fixes that have landed in If we aren't going to get a fix to that issue in a timely fashion then we'll need to back those fixes out. |
@Lukasa Hi Cory, can you give me an update on the release date for this? My app crashes a lot because of this, using Vapor, and they are waiting for the release of NIO. It's been a long wait! Waiting -> Waiting) |
Hello! I'll aim to get you a release this week or next: we'll have to back some stuff out to work around the linked bug. |
Motivation
It was currently possible that the producer's delegate is getting called twice with
produceMore
even if noyield
returned astopProducing
. This could happen when we expected the producer to yield elements but the consumer went below the low watermark again. Resulting in two subsequent calls.Modification
This PR stores the current demand state in the strategy which let's us avoid flipping the
hasOustandingDemand
state of the sequence.Result
Correctly, ensured the call order of
produceMore
andstopProducing
.