You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
This PR changes the backpressure behavior of Flowable.groupBy to signal MissingBackpressureException instead of silently hanging if the produced groups are not ready to be accepted by the downstream.
This can happen if one flatMaps a groupBy but there are more groups produced than the concurrency level of flatMap. Since replenishment is tied to item consumption from the groups, not consuming them can result in none of the groups receiving any further items and the whole operator hangs.
The following changes have been applied:
Removed the queue from the main operator since it will now try to emit directly and not buffer groups.
The main Flowable, lacking a queue, no longer supports operator fusion. Tests checking this property have been removed as well.
When a group is drained, consumed items are replenished in batch if possible. Detecting a cancellation will also trigger a replenishment.
When a group is pulled (fusion mode), now all pull, isEmpty and clear will trigger replenishment so that other groups can make progress too.
Unit tests have been modified to have large enough bufferSize/prefetch amounts to allow them to pass.
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.
This PR changes the backpressure behavior of
Flowable.groupBy
to signalMissingBackpressureException
instead of silently hanging if the produced groups are not ready to be accepted by the downstream.This can happen if one
flatMap
s agroupBy
but there are more groups produced than the concurrency level offlatMap
. Since replenishment is tied to item consumption from the groups, not consuming them can result in none of the groups receiving any further items and the whole operator hangs.The following changes have been applied:
Flowable
, lacking a queue, no longer supports operator fusion. Tests checking this property have been removed as well.pull
,isEmpty
andclear
will trigger replenishment so that other groups can make progress too.Fixes #6641