You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/24 06:43:18 UTC

[GitHub] [pulsar] jerrypeng opened a new pull request #7351: Fix race condition in which exitFuture in FunctionAssignmentTailer never gets completed even though the tailer thread has exited

jerrypeng opened a new pull request #7351:
URL: https://github.com/apache/pulsar/pull/7351


   
   
   ### Motivation
   
   Method "startFromMessage()" can be called after method "triggerReadToTheEndAndExit()". Method "startFromMessage()" will reset the future to a new future, thus when the tailer thread exits the new future will be completed and the future returned by method "triggerReadToTheEndAndExit()" will never be completed
   
   
   ### Modifications
   
   Move the resetting the future in the close() method


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



[GitHub] [pulsar] aahmed-se commented on a change in pull request #7351: Fix race condition in which exitFuture in FunctionAssignmentTailer never gets completed even though the tailer thread has exited

Posted by GitBox <gi...@apache.org>.
aahmed-se commented on a change in pull request #7351:
URL: https://github.com/apache/pulsar/pull/7351#discussion_r444679448



##########
File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionAssignmentTailer.java
##########
@@ -113,6 +112,11 @@ public synchronized void close() {
                     }
                 }
                 tailerThread = null;
+
+                // complete exit future to be safe
+                exitFuture.complete(null);
+                // reset the future
+                exitFuture = new CompletableFuture<>();

Review comment:
       What are you trying to do assign a completed future ?




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



[GitHub] [pulsar] jerrypeng commented on pull request #7351: Fix race condition in which exitFuture in FunctionAssignmentTailer never gets completed even though the tailer thread has exited

Posted by GitBox <gi...@apache.org>.
jerrypeng commented on pull request #7351:
URL: https://github.com/apache/pulsar/pull/7351#issuecomment-648640488


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] srkukarni merged pull request #7351: Fix race condition in which exitFuture in FunctionAssignmentTailer never gets completed even though the tailer thread has exited

Posted by GitBox <gi...@apache.org>.
srkukarni merged pull request #7351:
URL: https://github.com/apache/pulsar/pull/7351


   


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



[GitHub] [pulsar] jerrypeng commented on a change in pull request #7351: Fix race condition in which exitFuture in FunctionAssignmentTailer never gets completed even though the tailer thread has exited

Posted by GitBox <gi...@apache.org>.
jerrypeng commented on a change in pull request #7351:
URL: https://github.com/apache/pulsar/pull/7351#discussion_r444679824



##########
File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionAssignmentTailer.java
##########
@@ -113,6 +112,11 @@ public synchronized void close() {
                     }
                 }
                 tailerThread = null;
+
+                // complete exit future to be safe
+                exitFuture.complete(null);
+                // reset the future
+                exitFuture = new CompletableFuture<>();

Review comment:
       just reset it because this object can be close() and start() again




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