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

1.x: fix ReplaySubject anomaly around caughtUp by removing that optimization #4051

Merged
merged 1 commit into from
Jun 22, 2016

Conversation

akarnokd
Copy link
Member

Adding the backpressure support to ReplaySubject exposed a race condition around the caughtUp optimization.

The problem occurs when the source thread has caught up after drain() returned true but at the same time, a concurrent drain() starts running (due to a subscribe() process finishing or requesting on top of the previous Long.MAX_VALUE). This concurrent drain may think the replay hasn't started yet (by finding rp.node null) or seeing that the buffer has more elements (that may get double emitted).

The current solution is to remove this optimization until we come up with a correct optimization.

Related: #4028.

@akarnokd akarnokd added the Bug label Jun 21, 2016
@codecov-io
Copy link

Current coverage is 80.49%

Merging #4051 into 1.x will increase coverage by 0.11%

@@                1.x      #4051   diff @@
==========================================
  Files           253        253          
  Lines         16478      16469     -9   
  Methods           0          0          
  Messages          0          0          
  Branches       2500       2491     -9   
==========================================
+ Hits          13244      13256    +12   
+ Misses         2341       2331    -10   
+ Partials        893        882    -11   

Powered by Codecov. Last updated by 535fb75...788f3bd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants