-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Flux getting stuck in case of any java.lang.Error(OOM) #2521
Copy link
Copy link
Closed
Labels
status/declinedWe feel we shouldn't currently apply this change/suggestionWe feel we shouldn't currently apply this change/suggestion
Description
In parallel flux whenever there is OOM in one of the threads, the whole process is getting stuck until we kill it manually. I have created an example to simulate it. Please refer the following code:
@Test
public void test_Flux() {
Flux.range(1, 30)
.parallel(6)
.runOn(Schedulers.fromExecutor(Executors.newFixedThreadPool(6)))
.doOnNext(this::writeValues)
.sequential()
.blockLast();
}
private void writeValues(int val) {
if (val == 10) {
throw new OutOfMemoryError("failed here");
// throw new RuntimeException("failed here");
}
System.out.println("the thread name is :" + Thread.currentThread().getName() + " val is :" + val);
sleep(3);
}
private void sleep(int i) {
try {
Thread.sleep(i * 1000L);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Can we crash here instead of getting stuck?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status/declinedWe feel we shouldn't currently apply this change/suggestionWe feel we shouldn't currently apply this change/suggestion