viafintech / gcra-ruby

Generic cell rate algorithm (leaky bucket) implementation for rate limiting
MIT License
51 stars 10 forks source link

Add support for automatically reconnecting if a readonly host was detected #7

Closed tobischo closed 3 years ago

tobischo commented 3 years ago

When the primary of a cluster fails over to a secondary the connection remains open to the primary. Trying to write against the new secondary will not work, as it is in readonly mode. In order to better handle this, this allows configuring GCRA to trigger an automatic reconnect. That behaviour is optional though and requires explicit opt-in