Skip to content

[rpc] RequestChannel backpressure transitions can use stale queue state#4016

Description

@fxbing

Search before asking

  • I searched in the issues and found nothing similar.

Fluss version

main (development)

Please describe the bug 馃悶

RequestChannel checks the queue threshold before acquiring backpressureLock, but does not recheck it when changing isBackpressureActive.

The queue may change concurrently, causing channels to be paused after the queue has been drained, or resumed after it has reached the backpressure threshold.

The queue size in the log is also read later in the asynchronous EventLoop task, producing misleading messages such as:

Queue size (0) exceeded backpressure threshold (100)

This behavior was introduced by #2065.

Solution

Reconcile the latest queue size and backpressure state under backpressureLock before applying pause or resume.

Capture the queue size at the state transition and use that snapshot in the asynchronous log.

Add concurrent regression tests covering stale pause and resume transitions.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions