Github user zhijiangW commented on a diff in the pull request:
https://github.com/apache/flink/pull/4559#discussion_r155458048
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SpillableSubpartitionView.java
---
@@ -145,6 +145,10 @@ public Buffer getNextBuffer() throws IOException,
InterruptedException {
listener.notifyBuffersAvailable(1);
}
+ if (current.isBuffer()) {
--- End diff --
I think the `decreaseStatistics` should be inside the
`getNextBufferInternal`, otherwise the backlog value is not thread-safe. The
previous implementation can make the 'decreaseStatistics` inside the
synchronized part.
---