BewareMyPower commented on code in PR #25111:
URL: https://github.com/apache/pulsar/pull/25111#discussion_r2644755749
##########
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:
It should be called after `protocolHandlers.close()` because the `close`
method of protocol handler might do some cleanup jobs that rely on the
connection.
--
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]