You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i was trying to execute some concurrent calls and found an unexpected behaviour. In the JavaDoc of UniAndGroupIterable<O> unis(java.lang.Iterable<? extends Uni<?>> unis) in class UniZip it is written:
The produced Uni fires a failure event if one of the Unis fires a failure. This will cause the other Uni to be cancelled, expect if UniAndGroupIterable.collectFailures() is invoked which delay the failure event until all Unis have fires an item or failure event.
But i found that when i combine some unis without calling collectFailures() and one of them fails the rest of them are not cancelled and continue the execution.
I made a simple naive test that should reproduce the issue
And if you run it a few times the output is similar to this (it may change a litle bit due to Collection.shuffle randomness)
Complete 5
Complete 4
Complete 0
Complete 8
Complete 1
Complete 7
Fail!!!
Failed: This is a test failure
Complete 2
Complete 3
Complete 6
Complete 9
Maybe there is something that i'm missing but i was expecting that after a failure all the remaining unis (the one that are still sleeping when the failure occurs) are canceled.
Is this a bug or maybe i'm doing something wrong? The mutiny library that i'm using is the one that comes with quarkus 2.2.1.Final ( i think it is version 1.0.0).
The text was updated successfully, but these errors were encountered:
I suspect that you intended to run concurrent operations, but please note that everything is being executed on the same (subscription) thread. So each Uni blocks the thread to sleep, then passes the torch to the next Uni that sleeps, etc.
Hi @jponge maybe i explained myself wrong but even in my previous example the overall combination fails: when i subscribe after a while i receive a failure event that gets printed with the fail -> System.out.println("Failed: " + fail.getMessage()) lambda passed as second parameter to the subscribe() method. My concern was more on the fact that the operations that are blocked when the failure event is emitted are not canceled automatically and continue to execute.
I know that is a bad practice but if the concurrent tasks performs operation like a heavy computation, in the case of a failure all the remaining computation, succesfull or not, are "wasted". Is there any way to achieve this behaviour?
Hi, i was trying to execute some concurrent calls and found an unexpected behaviour. In the JavaDoc of
UniAndGroupIterable<O> unis(java.lang.Iterable<? extends Uni<?>> unis)
in class UniZip it is written:But i found that when i combine some unis without calling collectFailures() and one of them fails the rest of them are not cancelled and continue the execution.
I made a simple naive test that should reproduce the issue
And if you run it a few times the output is similar to this (it may change a litle bit due to Collection.shuffle randomness)
Maybe there is something that i'm missing but i was expecting that after a failure all the remaining unis (the one that are still sleeping when the failure occurs) are canceled.
Is this a bug or maybe i'm doing something wrong? The mutiny library that i'm using is the one that comes with quarkus 2.2.1.Final ( i think it is version 1.0.0).
The text was updated successfully, but these errors were encountered: