lhotari commented on code in PR #25111:
URL: https://github.com/apache/pulsar/pull/25111#discussion_r2657744133


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:
##########
@@ -506,6 +506,15 @@ public CompletableFuture<Void> closeAsync(boolean 
waitForWebServiceToStop) {
             // Close protocol handler before unloading namespace bundles 
because protocol handlers might maintain
             // Pulsar clients that could send lookup requests that affect 
unloading.
             if (protocolHandlers != null) {
+                try {
+                    List<CompletableFuture<Void>> channelCloseFutures =
+                            brokerService.closeProtocolHandlerChannels();
+                    // Wait for all protocol handler channels to close before 
closing protocol handlers
+                    FutureUtil.waitForAll(channelCloseFutures).get();
+                    LOG.info("Protocol handler channels closed successfully");
+                } catch (Exception e) {
+                    LOG.warn("Failed to close protocol handler channels", e);
+                }

Review Comment:
   @BewareMyPower I think that it should be fine to close the channels before 
protocol handlers. The reason for this is that the channels that are being 
closed are ServerChannel instances and wouldn't impact existing connections. 
Closing the ServerChannels will prevent new connections being opened.



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