Skip to content

Commit

Permalink
fix(concatMap): deadlock on inner upstream subscription
Browse files Browse the repository at this point in the history
Forwarding signals must not happen under locking conditions!
  • Loading branch information
jponge committed Jan 26, 2024
1 parent 796003c commit f18296b
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,10 @@ public void onSubscribe(Flow.Subscription subscription) {
private void innerOnSubscribe(Flow.Subscription subscription) {
stateLock.lock();
innerUpstream = subscription;
try {
long n = demand;
if (n > 0L) {
subscription.request(n);
}
} finally {
stateLock.unlock();
long n = demand;
stateLock.unlock();
if (n > 0L) {
subscription.request(n);
}
}

Expand Down

0 comments on commit f18296b

Please sign in to comment.