Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-9866: Fix
FluxMessageChannel
for race condition on destroy
Fixes: #9866 Issue link: #9866 Due to race condition between `sink.tryEmitNext()` and `sink.emitComplete()``, there could be a situation when `onNext` signal slips after `onComplete`. Appears on fast producers into this `FluxMessageChannel`. That leads to error like `Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.` * Fix `FluxMessageChannel` to check for `this.active` one more time just before `sink.tryEmitNext()` call * Also mitigate a race condition with a `Sinks.EmitFailureHandler.busyLooping(Duration.ofSeconds(1))` in the `destroy()` instead of `Sinks.EmitFailureHandler.FAIL_FAST`. The `busyLooping()` would retry requested `onComplete()` signal for that specific error until success or timeout (cherry picked from commit 7680e02)
- Loading branch information