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/06/14 03:34:58 UTC

[GitHub] [pulsar] BewareMyPower commented on a diff in pull request #16043: [improve][broker] Avoid reconnection when a partitioned topic was created concurrently

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -4085,9 +4085,21 @@ public static CompletableFuture<PartitionedTopicMetadata> unsafeGetPartitionedTo
                 }
                 metadataFuture.complete(metadata);
             }).exceptionally(ex -> {
-            metadataFuture.completeExceptionally(ex.getCause());
-            return null;
-        });
+                    if (ex.getCause() instanceof MetadataStoreException.AlreadyExistsException) {
+                        // The partitioned topic might be created concurrently
+                        pulsar.getBrokerService().fetchPartitionedTopicMetadataAsync(topicName)

Review Comment:
   Good suggestions. I was concerned about the effect on other places before. But it should be the right behavior for it, including the admin operations.



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