You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/11 08:58:12 UTC

[GitHub] [flink] zhijiangW commented on a change in pull request #11877: [FLINK-16641][network] Announce sender's backlog to solve the deadlock issue without exclusive buffers

zhijiangW commented on a change in pull request #11877:
URL: https://github.com/apache/flink/pull/11877#discussion_r422889022



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedSequenceNumberingViewReader.java
##########
@@ -94,13 +99,27 @@ public void requestSubpartitionView(
 	}
 
 	@Override
-	public void addCredit(int creditDeltas) {
+	public boolean addCredit(int creditDeltas) {
 		numCreditsAvailable += creditDeltas;
+		return shouldAnnounceBacklog();
+	}
+
+	@Override
+	public boolean shouldAnnounceBacklog() {
+		return initialCredit == 0 && numCreditsAvailable == 0 && subpartitionView.isAvailable(Integer.MAX_VALUE);
 	}
 
 	@Override
-	public void resumeConsumption() {
+	public boolean resumeConsumption(int availableCredit, int unfulfilledBacklog) {
+		if (initialCredit > 0) {
+			checkState(numCreditsAvailable == availableCredit, "Illegal number of available credit.");

Review comment:
       I guess this check is not necessary or invalid.




----------------------------------------------------------------
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:
users@infra.apache.org