jerrypeng commented on a change in pull request #8687:
URL: https://github.com/apache/pulsar/pull/8687#discussion_r530689243



##########
File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionAssignmentTailer.java
##########
@@ -145,7 +145,7 @@ private Thread getTailerThread() {
                 try {
                     Message<byte[]> msg = reader.readNext(1, TimeUnit.SECONDS);
                     if (msg == null) {
-                        if (exitOnEndOfTopic && !reader.hasMessageAvailable()) 
{
+                        if (exitOnEndOfTopic && 
!reader.hasMessageAvailableAsync().get(10, TimeUnit.SECONDS)) {

Review comment:
       When the timeout expires, a TimeoutException will be thrown and which 
will force the worker to shutdown and restart.  Another worker can more process 
to becoming leader.




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


Reply via email to