zhijiangW commented on a change in pull request #11351: [FLINK-16404][runtime]
Solve the potential deadlock problem when reducing exclusive buffers to zero
URL: https://github.com/apache/flink/pull/11351#discussion_r396206957
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java
##########
@@ -311,10 +309,13 @@ public void recycle(MemorySegment segment) {
ExceptionUtils.rethrow(t);
}
}
- numAddedBuffers = bufferQueue.addExclusiveBuffer(new
NetworkBuffer(segment, this), numRequiredBuffers);
+ checkState(!isBlockedByCheckpoint, "Channel blocked by
checkpoint.");
+
+ int numAddedBuffers =
bufferQueue.addExclusiveBuffer(new NetworkBuffer(segment, this),
numRequiredBuffers);
+ notifyAvailable = numAddedBuffers > 0 &&
unannouncedCredit++ == 0;
}
- if (numAddedBuffers > 0 &&
unannouncedCredit.getAndAdd(numAddedBuffers) == 0) {
+ if (notifyAvailable) {
Review comment:
This change is irrelated?
If so, I suggest not making this change.
----------------------------------------------------------------
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