forked from DataDog/glommio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make a stronger distinction between add_waiter use cases
It used to be the case where we would assume there was a single waiter per source, but in the read_many work we moved that to many-waiters. The function that manipulates the wakers was kept the same, so whether or not we had many wakers was entirely up to the user. However I just found a use case (issue DataDog#391) where there are many waiters added to a source that only expects a single waiter. That's a use case in which we reuse a source, and we keep calling the poll function into a stream even though the stream is never ready. It's not clear to me (yet) why this is the case. It is certainly surprising. While I want to get to the bottom of this, it is not a bad idea to require the user to ask for their intentions explicitly. In the future, if we can indeed guarantee that a function with a single waiter should be empty we can use this opportunity for a stronger assert. For now, this reverts the old behavior in the original users and at least gets rid of this particular regression Fixes DataDog#391
- Loading branch information
Glauber Costa
committed
Aug 9, 2021
1 parent
c781af1
commit b301484
Showing
5 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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