repeatWhenEmpty hangs on cancel when discard hook is present #2196
Labels
good first issue
Ideal for a new contributor, we'll help
help wanted
We need contributions on this
type/bug
A general bug
Milestone
Expected Behavior
It should be safe to cancel the sequence.
Actual Behavior
Cancelling a sequence which is in a
repeatWhenEmpty()
loop will cause issues when a discard hook has been registered. In that caseOperators.onDiscardMultiple()
is invoked with the iterator used to keep track of the current iteration and the hook would be called for every remaining number up toLong.MAX_VALUE
.Steps to Reproduce
This test case will succeed when removing the
doOnDiscard()
operator.Possible Solution
Probably we should treat the remaining iterations in a way that they can be safely discarded without bothering any application level hooks. Also, I guess
FluxStream
should not be considered "knownToBeFinite" if its size isLong.MAX_VALUE
.Your Environment
The text was updated successfully, but these errors were encountered: