poorbarcode commented on code in PR #22858: URL: https://github.com/apache/pulsar/pull/22858#discussion_r1629974198
########## pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java: ########## @@ -744,6 +745,21 @@ public void close() throws PulsarClientException { } } + private void closeUrlLookupMap() { + Map<String, LookupService> closedUrlLookupServices = new HashMap(urlLookupMap.size()); + urlLookupMap.entrySet().forEach(e -> { + try { + e.getValue().close(); + } catch (Exception ex) { + log.error("Error closing lookup service {}", e.getKey(), ex); + } + closedUrlLookupServices.put(e.getKey(), e.getValue()); + }); + closedUrlLookupServices.entrySet().forEach(e -> { Review Comment: > Why did you retain the lookup services that failed to close? It seems that there is no chance to close these lookup services again. Once the map is not empty after closing, it means something is wrong. Just left the information, so we can do a troubleshooting through a client-side heap dump 😂 PS: troubleshooting is always difficult through logs. The more information there, the easier troubleshooting is -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org