Skip to content
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 PublisherFlatMapSingle's demand handling #1627

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

tkountis
Copy link
Contributor

Motivation:

PublisherFlatMapSingle was recently changed to better handle excpetions, but the changes
affected the way the drain counter was updating, which as a result created wrong demand upstream.

Modifications:

Init the counter inside the loop to reset it everytime there is contention and the lock is re-acquired.

Result:

Proper counting of delivered items and thus proper demand requests.

@tkountis tkountis added the bug Something isn't working label Jun 21, 2021
@tkountis tkountis self-assigned this Jun 21, 2021
@tkountis tkountis force-pushed the fix/flatMapSingle_drain_count branch from a61e2a2 to ecc69e2 Compare June 21, 2021 16:19
@tkountis
Copy link
Contributor Author

Build failure #1579

Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good finding!
Minor comments for the test:

@tkountis tkountis force-pushed the fix/flatMapSingle_drain_count branch 2 times, most recently from 3c685aa to fb6bc84 Compare June 22, 2021 09:39
Motivation:

PublisherFlatMapSingle was recently changed to better handle excpetions, but the changes
affected the way the drain counter was updating, which as a result created wrong demand upstream.

Modifications:

Init the counter inside the loop to reset it everytime there is contention and the lock is re-acquired.

Result:

Proper counting of delivered items and thus proper demand requests.
@tkountis tkountis force-pushed the fix/flatMapSingle_drain_count branch from fb6bc84 to c354772 Compare June 22, 2021 12:43
@tkountis tkountis merged commit 2a9d6cf into apple:main Jun 22, 2021
@tkountis tkountis deleted the fix/flatMapSingle_drain_count branch June 22, 2021 13:05
bondolo pushed a commit that referenced this pull request Jun 28, 2021
Motivation:

PublisherFlatMapSingle was recently changed to better handle excpetions, but the changes
affected the way the drain counter was updating, which as a result created wrong demand upstream.

Modifications:

Init the counter inside the loop to reset it everytime there is contention and the lock is re-acquired.

Result:

Proper counting of delivered items and thus proper demand requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants