Description
Expected Behavior
According to the javadoc onErrorContinue()
should
recover from errors by dropping the incriminating element from the sequence and continuing with subsequent elements.
Actual Behavior
In an (possibly) infinite Flux
, after 256 invocations of onErrorContinue()
the Flux stops processing elements.
Steps to Reproduce
@Test
public void repoCase() {
int numberOfRequests = 500;
Set<Integer> sink = new HashSet<>();
Flux
.fromStream(IntStream.range(0, numberOfRequests).boxed())
.map(sink::add)
.flatMap(i -> Mono.error(new Exception("any")))
.onErrorContinue((throwable, o) -> {})
.subscribe();
Thread.sleep(1000);
Assertions.assertNotEquals(numberOfRequests, sink.size());
Assertions.assertEquals(256, sink.size());
}
Possible Solution
I have no clue how to solve this. Just the fact, that it is reproducible 256, let me guess that some kind of state or metainformation like the Context
is stored within just one bit an is just full after 256 entries.
Your Environment
I used a standard spring boot application created from the initializer with spring boot version 2.2.2.RELEASE. Thus the version of reactor core is 3.3.1.RELEASE.
- Reactor version(s) used:
- Other relevant libraries versions (eg.
netty
, ...): - JVM version (
javar -version
):
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode) - OS and version (eg
uname -a
):
Windows 10 Enterprise, Version 1703
I already asked the question in the community but didn't receive any answer, but comments on how to circumvent onErrorContinue()
: https://stackoverflow.com/questions/59649584/limit-for-onerrorcontinue-in-flux