Fix: Flux.zip does not emit errors from concurrent sources#4041
Open
georgebanasios wants to merge 1 commit intoreactor:mainfrom
Open
Fix: Flux.zip does not emit errors from concurrent sources#4041georgebanasios wants to merge 1 commit intoreactor:mainfrom
georgebanasios wants to merge 1 commit intoreactor:mainfrom
Conversation
Signed-off-by: George Banasios <banasiosgeorge@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3917
A race condition existed where a concurrent
onCompletesignal from one source and anonErrorsignal from another could result in theonErrorsignal being dropped.Solution:
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.Atomic Terminal State Tie-Breaker: Enhanced the
drain()loop logic to useExceptions.TERMINATEDas 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.