mattisonchao commented on code in PR #19374:
URL: https://github.com/apache/pulsar/pull/19374#discussion_r1106766784


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:
##########
@@ -204,23 +208,48 @@ protected CompletableFuture<List<String>> 
internalGetNonPersistentTopics(Policie
                 });
     }
 
-    @SuppressWarnings("unchecked")
-    protected CompletableFuture<Void> internalDeleteNamespaceAsync(boolean 
force) {
+    /**
+     * Delete the namespace and retry to resolve some topics that were not 
created successfully(in metadata)
+     * during the deletion.
+     */
+    protected @Nonnull CompletableFuture<Void> 
internalDeleteNamespaceAsync(boolean force) {
+        final CompletableFuture<Void> future = new CompletableFuture<>();
+        RetryUtil.retryAsynchronously(() -> 
internalDeleteNamespaceAsync0(force),
+                new BackoffBuilder()
+                        .setInitialTime(200, TimeUnit.MILLISECONDS)
+                        .setMandatoryStop(15, TimeUnit.SECONDS)

Review Comment:
   Hi, @eolivelli 
   I am trying to use the number of retrying to instead back off. 
   
   >what happens if the user gives up waiting and then it issues again the same 
command while the backoff is still running ? Ideally everything should work 
well and the second execution should wait for the previous execution to 
complete. The expectation for the user is that when the command completes the 
namespace is deleted.
   
   For this problem, we can give some kind of the same operation a distributed 
lock to avoid calling the same operation concurrently. I can send the 
discussion to the mailing list.



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