nodece commented on code in PR #17017:
URL: https://github.com/apache/pulsar/pull/17017#discussion_r943056423


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:
##########
@@ -411,6 +411,8 @@ public CompletableFuture<Void> closeAsync() {
             LOG.info("Closing PulsarService");
             state = State.Closing;
 
+            functionWorkerService.ifPresent(WorkerService::stop);

Review Comment:
   @RobertIndie 
   
   > What do you mean by cli code?
   
   PulsarBrokerStarter belongs to cli code, it is called by using the `pulsar 
broker`. 
   
   >  I see that the functionWorkerService is passed to the PulsarService by 
here:
   
   We support passing the functionWorkerService to PulsarService, but the 
function worker should be closed by PulsarService, not PulsarBrokerStarter, 
which is a component of PulsarService.
   
   If we don't close the functionWorkerService when running the close method of 
PulsarService, the functionWorkerService will break the PulsarService running, 
because the functionWorkerService cannot request the broker service, then call 
the PulsarService shutdown method. So when close and shutdown methods run 
together, the shutdown method will break 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to