apache / apache/pulsar-client-go

Connection backoff should be used if broker continually disconnects

Open
#810 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
745
Forks
389
Avg merge
3d 20h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.