Pomelongan commented on code in PR #17206:
URL: https://github.com/apache/pulsar/pull/17206#discussion_r951436409


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -1559,19 +1560,37 @@ protected void 
internalSetPersistence(PersistencePolicies persistence) {
 
     private void doUpdatePersistence(PersistencePolicies persistence) {
         try {
-            updatePolicies(namespaceName, policies -> {
-                policies.persistence = persistence;
-                return policies;
-            });
-            log.info("[{}] Successfully updated persistence configuration: 
namespace={}, map={}", clientAppId(),
-                    namespaceName, 
jsonMapper().writeValueAsString(persistence));
+            
doUpdatePersistenceAsyn(persistence).get(namespaceResources().getOperationTimeoutSec(),
 TimeUnit.SECONDS);
         } catch (Exception e) {
-            log.error("[{}] Failed to update persistence configuration for 
namespace {}", clientAppId(), namespaceName,
-                    e);
-            throw new RestException(e);
+            Throwable cause = e.getCause();
+            if (!(cause instanceof RestException)) {
+                throw new RestException(cause);
+            } else {
+                throw (RestException) cause;
+            }
         }
     }
 
+    private CompletableFuture<Void> 
doUpdatePersistenceAsyn(PersistencePolicies persistence) {
+        CompletableFuture<Void> result = new CompletableFuture<>();
+        updatePoliciesAsync(namespaceName, policies -> {

Review Comment:
   Thank you for your review. I have revised it



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