BewareMyPower commented on code in PR #24934:
URL: https://github.com/apache/pulsar/pull/24934#discussion_r2486393469
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java:
##########
@@ -161,7 +163,21 @@ private NavigableMap<Integer, Integer> makeHashRing(int
consumerSize) {
return Collections.unmodifiableNavigableMap(hashRing);
}
- public synchronized CompletableFuture<Void> addConsumer(Consumer consumer)
{
+ public CompletableFuture<Void> addConsumer(Consumer consumer) {
+ return internalAddConsumer(consumer, 0);
+ }
+
+ private synchronized CompletableFuture<Void> internalAddConsumer(Consumer
consumer, int retryCount) {
+ if (retryCount >= MAX_RETRY_COUNT_FOR_ADD_CONSUMER_RACE) {
+ log.warn("[{}] The active consumer's connection is still inactive
after all retries, remove {} by force",
+ getName(), consumer);
+ try {
+ removeConsumer(consumer);
Review Comment:
Okay, so I think in this case, we should return an error. This is a rare
case. In case it happens, we could unload the topic to remove the consumer by
force.
--
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]