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



##########
File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionMetaDataTopicTailer.java
##########
@@ -77,12 +89,25 @@ public void run() {
                     if (!(th instanceof InterruptedException || th.getCause() 
instanceof InterruptedException)) {
                         log.warn("Encountered error when metadata tailer is 
not running", th);
                     }
-                    return;
                 }
             }
         }
     }
 
+    public void stopWhenNoMoreMessages() {
+        stopOnNoMessageAvailable = true;
+        readerThread.interrupt();

Review comment:
       I don't think this is the right approach.  You might be interrupting a 
message being processed.  The goal is the reach to the end and process all the 
messages.  I would just doing something similar to what I have done here:
   
https://github.com/apache/pulsar/pull/7237/files#diff-fb140c4ab9a86232f8d85b90cf0d3705R168




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


Reply via email to