jdswinbank / Comet

A complete VOEvent transport system
http://comet.transientskp.org/
BSD 2-Clause "Simplified" License
23 stars 9 forks source link

Subscriber reconnection on failed auth doesn't back off #29

Closed jdswinbank closed 10 years ago

jdswinbank commented 10 years ago

When the subscriber fails to connect to a broker, it uses an exponential back off to avoid a series of rapid-fire reconnections. However, as soon as a connection is made, the timer on that back-off is reset to zero.

If the broker is checking for authenticated subscribers, the connection might be successful but the broker shortly thereafter terminates it when the subscriber fails to authenticate. However, the successful connection has reset the back-off, so the subscriber immediately reconnects and tries to re-authenticate, and so on, ad infinitum.

A smarter approach would be to avoid resetting the back off until a few seconds after the connection has been made to give the remote time to disconnect.