Fix fair-backpressure bufferTimeout flushing a partial buffer on resumed demand - #4380
Open
hunseonglee wants to merge 1 commit into
Open
hunseonglee wants to merge 1 commit into
hunseonglee wants to merge 1 commit into
Conversation
…med demand The fair-backpressure drain treated resumed downstream demand as a flush trigger on its own, so an open buffer that was neither full nor timed out was emitted immediately when a request arrived after demand had been exhausted. Buffers are now only flushed when full, timed out, or left over after upstream termination, matching the operator contract and the non-fair implementation. Signed-off-by: seonghun lee <harrisleesh@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bufferTimeoutwithfairBackpressure = trueflushed the currently open buffer whenever downstream demand resumed (arequest(n)arriving whilerequested == 0), even though the buffer was neither full nor timed out — violating the documented "maxSize OR maxTime" contract that the non-fair variant honors.This change removes the
resumeDemandflush trigger fromBufferTimeoutWithBackpressureSubscriber.drain()(and the now-unused parameter at its 6 call sites). The legitimate flush conditions remain covered by the sticky TIMEOUT/TERMINATED flags andindex >= batchSize; residual-buffer delivery on later requests is guaranteed by the timer reschedule introduced in f185b9b.Added a virtual-time regression test asserting the partial buffer is not delivered synchronously inside
request()before its timeout; it fails onmainand passes with the fix.FluxBufferTimeoutFairBackpressureTestpasses 19/19 (includingdownstreamNoReplenishButTimeout,bufferWithTimeoutAvoidingNegativeRequests,processesLargeDataset,backpressureSupported), andFluxBufferTimeoutTestis green.Fixes #4377