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

Connection backoff should be used if broker continually disconnects

Open pgier opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

If I have a broker which is allowing connections, but is broken in some way that it disconnects from the client, then the backoff timer is reset, and the client will continually reconnect and disconnect without respecting the backoff timer.

The specific situation I came across is that I had a broken bookkeeper. My client app would connect to the broker, the broker would error saying that it cannot send the message and disconnect the client. The client immediately reconnects the to broker and retries to send the message. The call to producer.Send never returns to my client code, the app gets stuck in this reconnect loop infinitely.

Describe the solution you'd like The backoff timer should take effect if the producer is unable to send messages, and not just if we can't connect to the broker at all. It might also be good for MaxReconnectToBroker to take effect in this case.

pgier avatar Jul 18 '22 15:07 pgier