-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Exception in the thread who subscribed the flux or mono #1078
Comments
add missing onNextDropped hook in Mono.create
add missing onNextDropped hook in Mono.create
@smaldini I believe this also fixes the minor inconsistency we talked about the other day. |
@stavalfi the PR that @smaldini opened (#1085) replaces the Additionally, even though it was also the case with the previous behaviour, you can customize the hook at the level of a given Flux.create(...)
.subscriberContext(Context.of("reactor.onOperatorError.local",
(droppedError, valueIfRelevant) -> {...process dropped error...}); Would you be able to quickly use a |
☝️merged into master and should be available in a snapshot soon, pending user feedback before we decide on a potential backport to 3.1 |
Hi team. thanks for the quick upgrade.
For solving that, I can see the following fix: Thanks again! |
My feedback: working great. When will this feature be added to 3.1? |
Flux.create and Mono.create don't use `onErrorDropped` anymore, preventing throws when the default behaviour is still in place. Instead, they call `onOperatorError` without signalling the resulting Throwable. This has a saner default of "swallowing" the exception rather than throwing it out of the reactive chain and causing problems. It can still be locally customized using the `Context` undocumented key approach. Also added a missing onNextDropped hook in Mono.create. This is a backport of #1085 (commit db244e0), as tracked in #1083
Great @stavalfi. This has now been backported in the |
The following scenario will prove theoretically that even if I check if the stream canceled before sending error signal, then flux will throw an exception to the subscribed thread: consider the following scenario inside Flux.create which the main thread subscribed to it (flux.create(..)....parallel()...take(1)...):
take(1)
and terminate the stream.In general, what are my options to avoid exceptions in the thread who subscribed the flux?
The text was updated successfully, but these errors were encountered: