New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent behavior of onErrorContinue() if a Publisher emits a single element which then produces an exception in a subsequent flatMap() operator #1684
Comments
Currently, However, the specified Because
|
It can be fixed by replacing error handling
It would retain the semantic, that if the error is consumed the subscriber gets |
For the In a separate 3.3 issue, we might want to consider implementing |
Since the code for a scalar (aka Callable) source is shared among a few operators other than Flux#flatMap (mergeSequential, switchMap and Mono flatMap/flatMapMany), a new boolean is introduced as an opt-in to the onErrorContinue support, to keep these operators consistent in how they deal with scalar sources vs classic sources.
Expected behavior
According to the documentation, Flux.flatMap() operator supports resuming on errors in the mapper function. However, it does not seem to be the case if a Flux emits a single element which then produces an exception in a subsequent
flatMap()
. The same holds true for Mono.flatMap() operator, although the javadocs do not tell about Error Mode Support.Actual behavior
onErrorContinue()
does not drop an incriminating element from a sequence if a Publisher emits a single element which then produces an exception in a subsequentflatMap()
operator.Steps to reproduce
Let's consider a few test cases written in Kotlin
Scenario 1 with
Flux
Scenario 2 with
Mono
Interestingly though, both tests turn green as soon as
flatMap {...}
is replaced with amap {...}
counterpart.Reactor Core version
3.2.8.RELEASE
JVM version (e.g.
java -version
)1.8
The text was updated successfully, but these errors were encountered: