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/07/17 15:07:25 UTC

[GitHub] [flink] rkhachatryan commented on a change in pull request #12912: [FLINK-18595][network] Fix the deadlock issue by task thread and canceler thread in RemoteInputChannel

rkhachatryan commented on a change in pull request #12912:
URL: https://github.com/apache/flink/pull/12912#discussion_r456489067



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java
##########
@@ -356,6 +356,13 @@ public Buffer getNextReceivedBuffer() {
 	@Override
 	public NotificationResult notifyBufferAvailable(Buffer buffer) {
 		NotificationResult notificationResult = NotificationResult.BUFFER_NOT_USED;
+		// Two remote channels might call this method mutually by task thread and canceller thread concurrently.
+		// To avoid deadlock issue we can check the released state to return immediately before synchronizing.
+		// See FLINK-18595 for details.
+		if (isReleased.get()) {
+			return notificationResult;

Review comment:
       Before the change, if channel `isReleased` then we also set `isWaitingForFloatingBuffers` to `false` below.
   I'm not sure that leaving it as `true` would be correct.
   WDYT?




----------------------------------------------------------------
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