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

3.x: Fix truncation bugs in replay() and ReplaySubject/Processor #6582

Merged
merged 3 commits into from
Jul 22, 2019

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Jul 22, 2019

This PR fixes several truncation bugs with the time and size-bound replay() operators and their hot class versions:

  • Unexpected removal of the last item just added due to becoming out-of-date at the lowest time resolution, creating a hole in the linked chain and hanging the consumer. Related failure.
  • Incorrect size accounting upon removing old entries leading to more items dropped than expected.

Sidenote: The operators and classes would benefit from a rewrite to improve on allocation and indirection. I wanted first to get the bugfixes and related tests done to have a known good baseline.

@akarnokd akarnokd added this to the 3.0 milestone Jul 22, 2019
@codecov
Copy link

codecov bot commented Jul 22, 2019

Codecov Report

Merging #6582 into 3.x will decrease coverage by 0.01%.
The diff coverage is 90.9%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6582      +/-   ##
============================================
- Coverage     98.24%   98.22%   -0.02%     
- Complexity     6180     6185       +5     
============================================
  Files           678      678              
  Lines         44900    44908       +8     
  Branches       6211     6214       +3     
============================================
  Hits          44110    44110              
- Misses          263      266       +3     
- Partials        527      532       +5
Impacted Files Coverage Δ Complexity Δ
...main/java/io/reactivex/subjects/ReplaySubject.java 97.51% <100%> (-0.19%) 50 <0> (ø)
.../java/io/reactivex/processors/ReplayProcessor.java 98.97% <100%> (-0.62%) 52 <0> (ø)
...nternal/operators/observable/ObservableReplay.java 96.29% <80%> (+1.05%) 19 <0> (ø) ⬇️
...ex/internal/operators/flowable/FlowableReplay.java 92.79% <88.88%> (ø) 19 <0> (ø) ⬇️
...l/operators/observable/ObservableFlatMapMaybe.java 87.58% <0%> (-8.5%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableFlatMapMaybe.java 91.78% <0%> (-4.35%) 2% <0%> (ø)
...activex/internal/schedulers/ExecutorScheduler.java 96% <0%> (-2.5%) 10% <0%> (ø)
...ernal/operators/flowable/FlowableFromIterable.java 95.18% <0%> (-1.61%) 5% <0%> (ø)
...perators/mixed/ObservableConcatMapCompletable.java 98.49% <0%> (-1.51%) 3% <0%> (ø)
...io/reactivex/subscribers/SerializedSubscriber.java 98.86% <0%> (-1.14%) 26% <0%> (-1%)
... and 18 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 028d33e...07148ec. Read the comment docs.

@akarnokd akarnokd merged commit ab6c4b3 into ReactiveX:3.x Jul 22, 2019
@akarnokd akarnokd deleted the ReplayTruncateBugfix branch July 22, 2019 20:52
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.

2 participants