315157973 commented on a change in pull request #11597:
URL: https://github.com/apache/pulsar/pull/11597#discussion_r684788645
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/OwnershipCache.java
##########
@@ -258,7 +261,12 @@ public OwnedBundle getOwnedBundle(NamespaceBundle bundle) {
CompletableFuture<OwnedBundle> future =
ownedBundlesCache.getIfPresent(bundle);
if (future != null && future.isDone() &&
!future.isCompletedExceptionally()) {
- return future.join();
+ try {
+ return
future.get(pulsar.getConfiguration().getZooKeeperOperationTimeoutSeconds(),
TimeUnit.SECONDS);
+ } catch (Exception e) {
+ log.error("Get owned bundle failed ", e);
+ return null;
Review comment:
Nice view, done
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java
##########
@@ -122,11 +122,17 @@ public ConsumerBuilderImpl(PulsarClientImpl client,
Schema<T> schema) {
//Issue 9327: do compatibility check in case of the default retry
and dead letter topic name changed
String oldRetryLetterTopic = topicFirst.getNamespace() + "/" +
conf.getSubscriptionName() + RetryMessageUtil.RETRY_GROUP_TOPIC_SUFFIX;
String oldDeadLetterTopic = topicFirst.getNamespace() + "/" +
conf.getSubscriptionName() + RetryMessageUtil.DLQ_GROUP_TOPIC_SUFFIX;
- if
(client.getPartitionedTopicMetadata(oldRetryLetterTopic).join().partitions > 0)
{
- retryLetterTopic = oldRetryLetterTopic;
- }
- if
(client.getPartitionedTopicMetadata(oldDeadLetterTopic).join().partitions > 0) {
- deadLetterTopic = oldDeadLetterTopic;
+ try {
+ if (client.getPartitionedTopicMetadata(oldRetryLetterTopic)
+ .get(client.conf.getOperationTimeoutMs(),
TimeUnit.MILLISECONDS).partitions > 0) {
+ retryLetterTopic = oldRetryLetterTopic;
+ }
+ if (client.getPartitionedTopicMetadata(oldDeadLetterTopic)
+ .get(client.conf.getOperationTimeoutMs(),
TimeUnit.MILLISECONDS).partitions > 0) {
+ deadLetterTopic = oldDeadLetterTopic;
+ }
+ } catch (Exception e) {
Review comment:
done
--
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]