pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

[BUG] Reconnection logic and Backoff policy doesn't work correctly

Open RobertIndie opened this issue 1 year ago • 2 comments

I found that there are some issues with the BackoffPolicy:

  1. We should use a new backoff instance for each use: https://github.com/apache/pulsar-client-go/blob/35ae05157b702804037446e1190a8f4e7557fdbf/pulsar/consumer_partition.go#L1656
  2. In the reconnection logic, the checking for IsMaxBackoffReached doesn't respect the pc.options.backoffPolicy. https://github.com/apache/pulsar-client-go/blob/35ae05157b702804037446e1190a8f4e7557fdbf/pulsar/consumer_partition.go#L1700 Actually, the IsMaxBackoffReached is incorrect. We should respect the operation timeout and check the whole retired time instead of the backoff delay time.
  3. From the view of API design, we should move the BackoffPolicy out of the internal package.

RobertIndie avatar Feb 28 '24 10:02 RobertIndie

@RobertIndie Is there any progress on this issue? Maybe I can handle it.

crossoverJie avatar Mar 13 '24 03:03 crossoverJie

Sure. Thanks. I assigned this to you.

RobertIndie avatar Mar 13 '24 03:03 RobertIndie