-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further fix async fusion in doFinally|AfterTerminate|onError (#3046)
As a follow-up to #3045, this commit introduces an ArchUnit rule to surface other cases where a Subscriber is a QueueSubscription but doesn't implement `onNext` (and thus can break ASYNC fusion). Three additional case have thus been surfaced, two of which cannot be fixed entirely. `doFinally`: in the `poll()` path there was no catching of `qs.poll()` exceptions BUT unfortunately there is no clean way to implement fused doFinally with thrown exceptions. For instance, assuming the following is fused: ``` .doFinally(sig -> signals.add("finally")) .doOnError(e -> signals.add("onError")) ``` then the `doFinally` handler is invoked BEFORE the doOnError (which is contrary to the documented order and the unfused order). This commit thus removes `Fuseable` trait from doFinally operators. `doAfterTerminate`: this is similar to the above situation, but fusion support needs not be entirely removed from `MonoPeekTerminal` if no "afterXxx" handler is defined. This commit thus forces fusion to be negotiated to `NONE` in case a `MonoPeekTerminal` has an `afterTerminateHandler`, and only in that case. `doOnError`: didn't catch polling exceptions either, so the `doOnError` handler from the above snippet was not even invoked. This commit fixes that case. Lastly, this commit fixes an out-of-order issue in `StepVerifier`'s handling of fusion: StepVerifierBuilder must cancel the upstream AFTER having propagated onError in ASYNC mode, otherwise it may hang.
- Loading branch information
1 parent
f215a64
commit 5d7a926
Showing
13 changed files
with
174 additions
and
429 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...core/src/blockHoundTest/java/reactor/core/scheduler/ReactorBlockHoundIntegrationTest.java
This file contains 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
This file contains 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
This file contains 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
56 changes: 0 additions & 56 deletions
56
reactor-core/src/main/java/reactor/core/publisher/FluxDoFinallyFuseable.java
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
56 changes: 0 additions & 56 deletions
56
reactor-core/src/main/java/reactor/core/publisher/MonoDoFinallyFuseable.java
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.