1996fanrui commented on code in PR #29058:
URL: https://github.com/apache/flink/pull/29058#discussion_r3901790399


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannel.java:
##########
@@ -559,31 +559,32 @@ protected int peekNextBufferSubpartitionIdInternal() 
throws IOException {
     public Optional<BufferAndAvailability> getNextBuffer() throws IOException {
         checkError();
 
-        // Read inRecovery and poll the recovered buffer under a single lock 
acquisition to avoid
-        // grabbing the monitor twice on the hot path.
-        boolean inRecovery;
-        Buffer recoveredBuf = null;
-        synchronized (recoveredBuffers) {
-            inRecovery = this.inRecovery;
-            if (inRecovery && !hasPendingPriorityEvent && 
!recoveredBuffers.isEmpty()) {
-                recoveredBuf = recoveredBuffers.poll();
+        if (needsRecovery) {

Review Comment:
   FYI: just wrap `inRecovery` with `if (needsRecovery) {`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to