pnowojski commented on a change in pull request #7911: [FLINK-11082][network] 
Fix the logic of getting backlog in sub partition
URL: https://github.com/apache/flink/pull/7911#discussion_r264220960
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartitionView.java
 ##########
 @@ -156,7 +156,8 @@ public BufferAndBacklog getNextBuffer() throws 
IOException, InterruptedException
                                checkState(nextBuffer.isFinished(),
                                        "We can only read from 
SpillableSubpartition after it was finished");
 
-                               newBacklog = 
parent.decreaseBuffersInBacklogUnsafe(nextBuffer.isBuffer());
+                               
parent.decreaseBuffersInBacklog(nextBuffer.isBuffer());
+                               newBacklog = parent.getBuffersInBacklog();
 
 Review comment:
   1. why have you split this method into two? What was wrong with 
`decreaseBuffersInBacklog` returning the backlog?
   2. why are you synchronizing here second time? You should be able to use 
`getBuffersInBacklogUnsafe()`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to