oneby-wang commented on issue #24707: URL: https://github.com/apache/pulsar/issues/24707#issuecomment-3258630001
Hi, @lhotari, I think TopicListWatcher behaves just like ProducerImpl and ConsumerImpl. TopicListWatcher https://github.com/apache/pulsar/blob/77b34cc5b0176ea81e0d358d3b0f79a6e930be82/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicListWatcher.java#L94-L114 ConsumerImpl https://github.com/apache/pulsar/blob/77b34cc5b0176ea81e0d358d3b0f79a6e930be82/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1123-L1151 ProducerImpl https://github.com/apache/pulsar/blob/77b34cc5b0176ea81e0d358d3b0f79a6e930be82/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L2097-L2124 The key point is this If block: if watcherFuture were done normally before, `subscribeFuture.completeExceptionally(exception)` will never return true, and `connectionFailed()` will return true, and TopicListWatcher will indefinitely keep on retrying until the client gets closed. If the program boot with pulsar connection failure, all ConsumerImpl, ProducerImpl, TopicListWatcher will failed and closed after retry in lookupDeadline timeout, and the program may fail to boot. But once they are successfully connected, even if the network is disconnected subsequently, they will keep retrying until the client gets closed. ConsumerImpl, ProducerImpl, TopicListWatcher, they behave in the same way. https://github.com/apache/pulsar/blob/77b34cc5b0176ea81e0d358d3b0f79a6e930be82/pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicListWatcher.java#L99 In TopicListWatcher, there's one thing we can optimize is stopping retry when actError isUnrecoverableError, just like ConsumerImpl. https://github.com/apache/pulsar/blob/77b34cc5b0176ea81e0d358d3b0f79a6e930be82/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1141-L1145 -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org