Rui Fan created FLINK-40524:
-------------------------------

             Summary: LocalInputChannel.getNextBuffer takes the 
recoveredBuffers monitor on every buffer even when the channel never needed 
recovery
                 Key: FLINK-40524
                 URL: https://issues.apache.org/jira/browse/FLINK-40524
             Project: Flink
          Issue Type: Sub-task
          Components: Runtime / Checkpointing
            Reporter: Rui Fan
            Assignee: Rui Fan


CDR added an unconditional `synchronized (recoveredBuffers)` to the 
local-consume hot path [1], but for channels built with `needsRecovery=false` 
(all local channels when CDR is off) `inRecovery` is always false and 
`recoveredBuffers` always empty, so the block is dead yet still costs a monitor 
acquire per buffer. Fix: since `needsRecovery` is final, gate the recovery 
block on it so the steady-state path skips the monitor entirely.

[1] 
https://github.com/apache/flink/blob/76e774e04ff84ea305714153c5f4790fff98437c/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannel.java#L566



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to