Skip to content

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Oct 5, 2020

In concatMap, there is a shortcut for when the mapped Flowable turns out to be a scalar value and thus the full subscription process can be skipped. This used a so-called weak subscription that expected non-concurrent requesting to emits its single value.

Unfortunately, there is a race condition for when the downstream requests exactly when this weak subscription is activated, resulting in either double emission or no emission at all. The fix is to do the proper compareAndSet to ensure the emission happens exactly once.

Backport of #7089

@akarnokd akarnokd merged commit 3d6403b into ReactiveX:2.x Oct 5, 2020
@akarnokd akarnokd deleted the ConcatMapScalarFix2x branch October 5, 2020 15:49
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