Closed
Description
These two blocks of code produce different orderings of the onSubscribe and request events.
Flux.just(3,5,11)
.log("step1")
.map(x -> x*x)
.log("step2")
.collectList()
.log("step3")
.block();
Flux.just(3,5,11)
.log("step1")
.subscribeOn(schedulerA)
.map(x -> x*x)
.log("step2")
.subscribeOn(schedulerB)
.collectList()
.log("step3")
.subscribeOn(schedulerC)
.block();
The first block shows the following sequence:
step1: onSubscribe
step2: onSubscribe
step3: onSubscribe
step1: request
step2: request
step3: request
Whereas the second block shows this sequence:
step3: onSubscribe
step3: request
step2: onSubscribe
step2: request
step1: onSubscribe
step1: request
It appears that ordering of subscribeOn and request signals isn't guaranteed. That said, @smaldini suggested I raise the issue as it might adversely impact metrics.
Here's the test case with logs:
ReactorTest2.java.zip