Skip to content

Conversation

akarnokd
Copy link
Member

Due to a bug in the Flowable.publish operator, it is not requesting more if there was a change in the subscriber array during an emission run in the non-fused operation mode.

Fixes: #6363

@akarnokd akarnokd added this to the 2.2 backlog milestone Jan 14, 2019
}
}

// if we did emit at least one element, request more to replenish the queue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does not this comment need an update?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this still applies if no change to the subscriber array happened.

@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #6364 into 2.x will increase coverage by <.01%.
The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6364      +/-   ##
============================================
+ Coverage     98.26%   98.26%   +<.01%     
- Complexity     6286     6288       +2     
============================================
  Files           673      673              
  Lines         45021    45023       +2     
  Branches       6224     6226       +2     
============================================
+ Hits          44242    44244       +2     
  Misses          246      246              
  Partials        533      533
Impacted Files Coverage Δ Complexity Δ
...x/internal/operators/flowable/FlowablePublish.java 98.31% <75%> (-0.42%) 11 <0> (ø)
...ernal/operators/flowable/FlowableFlatMapMaybe.java 88.88% <0%> (-4.35%) 2% <0%> (ø)
...nternal/operators/parallel/ParallelReduceFull.java 91.08% <0%> (-3.97%) 2% <0%> (ø)
...ava/io/reactivex/processors/BehaviorProcessor.java 96.86% <0%> (-2.25%) 60% <0%> (ø)
...rnal/operators/observable/ObservableSwitchMap.java 93.08% <0%> (-2.13%) 3% <0%> (ø)
.../operators/mixed/FlowableSwitchMapCompletable.java 98.94% <0%> (-1.06%) 2% <0%> (ø)
...perators/mixed/ObservableSwitchMapCompletable.java 98.94% <0%> (-1.06%) 3% <0%> (ø)
...perators/single/SingleFlatMapIterableFlowable.java 97.5% <0%> (-0.84%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableTimeoutTimed.java 98.37% <0%> (-0.82%) 3% <0%> (ø)
...vex/internal/operators/flowable/FlowableCache.java 97.72% <0%> (-0.76%) 37% <0%> (-1%)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7d0a33...2806986. Read the comment docs.

Copy link
Contributor

@artem-zinnatullin artem-zinnatullin left a comment

Choose a reason for hiding this comment

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

Overall it looks good, but comment


// if we did emit at least one element, request more to replenish the queue
if (d > 0) {
if (d != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I don't understand this particular change, how can we end up with negative d?

Otherwise it's same as previously used condition 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

d should be never negative, thus != is just fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

but then d > 0 is okay too, or is this a performance optimization?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is slighly faster.

TestHelper.assertBadRequestReported(Flowable.range(1, 5).publish());
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add link to original bug? #6363

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't usually include the issue number, that's what GitHub is for.

@akarnokd akarnokd merged commit 2eda9d8 into ReactiveX:2.x Jan 15, 2019
@akarnokd akarnokd deleted the ShareZipDeadlockFix branch January 15, 2019 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants