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



##########
File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionMetaDataTopicTailer.java
##########
@@ -54,19 +58,33 @@ public FunctionMetaDataTopicTailer(FunctionMetaDataManager 
functionMetaDataManag
         readerThread = new Thread(this);
         readerThread.setName("function-metadata-tailer-thread");
         this.errorNotifier = errorNotifier;
+        stopOnNoMessageAvailable = false;
     }
 
     public void start() {
         running = true;
+        exitFuture = new CompletableFuture<>();
         readerThread.start();
     }
 
     @Override
     public void run() {
-        while(running) {
+        while (running) {

Review comment:
       To check if we have really reached the end of the topic, I think its 
safer if we check reader.hasMessageAvailable() == false and reader.readNext(5, 
TimeUnit.SECONDS) returns null.




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