You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/05 08:46:57 UTC

[GitHub] [pulsar] poorbarcode commented on a diff in pull request #16951: [improve][broker]reduce unnecessary connection closes when bundle is being unloaded

poorbarcode commented on code in PR #16951:
URL: https://github.com/apache/pulsar/pull/16951#discussion_r938585777


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:
##########
@@ -411,8 +412,8 @@ private CompletableFuture<Optional<LookupResult>> findBrokerServiceUrl(
                         });
                     }
                 } else if (nsData.get().isDisabled()) {
-                    future.completeExceptionally(
-                            new IllegalStateException(String.format("Namespace bundle %s is being unloaded", bundle)));
+                    future.completeExceptionally(new BrokerServiceException.ServerMetadataException(

Review Comment:
   Is there only one way that “ bundle is being unloaded” can cause `nsData.get().isDisabled()`?  If so, I think it's a good change. 



##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceServiceTest.java:
##########
@@ -721,6 +723,35 @@ public void testModularLoadManagerRemoveInactiveBundleFromLoadData() throws Exce
         });
     }
 
+
+    @Test
+    public void testGetBrokerServiceUrlAsyncWhenBundleUnloading() throws Exception {

Review Comment:
   left 2 questions:
   
   1. Why not use 'unload bundle' to trigger the result 'nsdata.get ().isdisabled ()' ?
   2. If we need to verify the result "will not close the clientCnx when bundle is being unloaded", I think it is better to use 'clientcnx. close' to verify the result. Or we should change the title to "Lookup Response meta exception when bundle is being unloaded".  Now the test does not match the title.



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org