Skip to content

Conversation

@georgebanasios
Copy link
Contributor

Fixes #3917

A race condition existed where a concurrent onComplete signal from one source and an onError signal from another could result in the onError signal being dropped.

Solution:

  1. Synchronized Inner Subscriber State: The ZipCoordinator.error() method now takes full ownership of the termination sequence. It guarantees that the central error field is set before the inner subscriber's done flag is marked. This closes a timing window where the drain loop could previously see a done subscriber and mistakenly assume a completion.

  2. Atomic Terminal State Tie-Breaker: Enhanced the drain() loop logic to use Exceptions.TERMINATED as an atomic sentinel value. This acts as a definitive tie-breaker for racing terminal signals. We ensure that only the first signal (either an error or a completion) can claim the terminal state, with any subsequent signals being correctly handled or dropped.

@georgebanasios georgebanasios requested a review from a team as a code owner June 22, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FluxZip fails to deliver error from concurrently running sources

1 participant