BewareMyPower commented on code in PR #23349:
URL: https://github.com/apache/pulsar/pull/23349#discussion_r1777046307


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/store/TableViewLoadDataStoreImpl.java:
##########
@@ -92,7 +92,11 @@ public synchronized CompletableFuture<Void> 
removeAsync(String key) {
     public synchronized Optional<T> get(String key) {
         String msg = validateTableView();
         if (StringUtils.isNotBlank(msg)) {
-            throw new IllegalStateException(msg);
+            if (msg.equals(SHUTDOWN_ERR_MSG)) {
+                return Optional.empty();

Review Comment:
   Because we now shutdown the `LoadDataStore` in `disableBroker`. See the 
updated PR description:
   
   > Since LoadDataStore#get is still used in 
LeastResourceUsageWithWeight#select, don't throw an exception and return an 
empty in get. And handle the case that select might throw an exception in 
ExtensibleLoadManagerImpl#selectAsync.
   
   



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