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
While a thread is getting data from Flux, it it encounters any java.lang.Error or its subclasses, Flux goes into a hang state causing the whole application to hang.
This is the sample thread dump where we would see the hang:
"main" #1 prio=5 os_prio=31 tid=0x00007fb7d1808800 nid=0x1003 waiting on condition [0x000070000279e000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000076be96458> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at reactor.core.publisher.BlockingIterable$SubscriberIterator.hasNext(BlockingIterable.java:179)
at com.example.common.FluxHangIssue.main(FluxHangIssue.java:42)
Expected Behavior
Flux should not get into a hang state, rather should bubble up the error, or terminate / crash the process.
simonbasle
added
status/invalid
We don't feel this issue is valid, or the root cause was found outside of Reactor
and removed
❓need-triage
This issue needs triage, hasn't been looked at by a team member yet
labels
May 10, 2022
Reactor doesn't attempt to recover from a VirtualMachineError, of which OutOfMemoryError is a subclass. When such _Error_s occur, there is no telling in which state the JVM is and wether or not all components of the application will be able to recover. Generally, they won't.
It is not the case with allError subclasses, only the ones flagged by Exceptions.throwIfFatal(Throwable) and Exceptions.throwIfJvmFatal(Throwable) (including VirtualMachineError and subclasses, LinkageError, etc...)
While a thread is getting data from Flux, it it encounters any java.lang.Error or its subclasses, Flux goes into a hang state causing the whole application to hang.
This is the sample thread dump where we would see the hang:
Expected Behavior
Flux should not get into a hang state, rather should bubble up the error, or terminate / crash the process.
Actual Behavior
Goes into an infinite hang state.
Steps to Reproduce
This shows how to simulate the hang - https://github.com/kushagraThapar/cosmos-java-sdk-testing/blob/master/src/main/java/com/example/common/FluxHangIssue.java
Possible Solution
One solution that I think might work is to configure the
timeout
API on such flux, to avoid the hang and let reactor propagate theTimeoutException
This method shows how the hang can be avoided - https://github.com/kushagraThapar/cosmos-java-sdk-testing/blob/master/src/main/java/com/example/common/FluxHangIssue.java#L59
The text was updated successfully, but these errors were encountered: