You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2025/09/05 12:09:07 UTC

[I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

lhotari opened a new issue, #24707:
URL: https://github.com/apache/pulsar/issues/24707

   @coderzc @Technoboy- I think that the timeout solution could be a problem and that this PR was merged too early. The Pulsar Client is designed in a way where it should indefinitely keep on retrying until the client gets closed. This PR breaks that principle.
   
   _Originally posted by @lhotari in https://github.com/apache/pulsar/issues/24698#issuecomment-3258117626_
               


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

Posted by "oneby-wang (via GitHub)" <gi...@apache.org>.
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24707:
URL: https://github.com/apache/pulsar/issues/24707#issuecomment-3298134731

   > [@lhotari](https://github.com/lhotari) Thank you for pointing out this issue. It seems that according to what you said, only a small change is needed. Seems watcherFuture should be left uncompleted if connection has never been established, or it will trigger recheckPatternTimeout task. If this change works, I will create a PR. [oneby-wang#3](https://github.com/oneby-wang/pulsar/pull/3).
   
   looks good. In addition, I think it would be useful to set a closed flag when PatternMultiTopicsConsumerImpl is closing. After the closed flag is set, the possible exceptionally callback for watcherFuture shouldn't trigger a recheckPatternTimeout task. 
   


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


Re: [I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #24707: [Bug] TopicListWatcher retry behavior was changed in PR #24698
URL: https://github.com/apache/pulsar/issues/24707


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


Re: [I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

Posted by "oneby-wang (via GitHub)" <gi...@apache.org>.
oneby-wang commented on issue #24707:
URL: https://github.com/apache/pulsar/issues/24707#issuecomment-3297160976

   @lhotari Thank you for pointing out this issue. It seems that according to what you said, only a small change is needed. Seems watcherFuture should be left uncompleted if connection has never been established, or it will trigger recheckPatternTimeout task.
   If this change works, I will create a PR. https://github.com/oneby-wang/pulsar/pull/3.
   


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


Re: [I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

Posted by "oneby-wang (via GitHub)" <gi...@apache.org>.
oneby-wang commented on issue #24707:
URL: https://github.com/apache/pulsar/issues/24707#issuecomment-3301317812

   Hi @lhotari, comments is applied and PR is created, https://github.com/apache/pulsar/pull/24752


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


Re: [I] [Bug] TopicListWatcher retry behavior was changed in PR #24698 [pulsar]

Posted by "oneby-wang (via GitHub)" <gi...@apache.org>.
oneby-wang commented on issue #24707:
URL: https://github.com/apache/pulsar/issues/24707#issuecomment-3258660380

   I packaged the pulsar-client jar locally and verified it.


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