With these changes I want to fix the problem described in https://github.com/instacart/makara/issues/258 where lot of connection attempts are performed when primary/replica DBs configuration isn't usable.
I found that _makara_connection method tries to establish connection everytime it's called when @connection is nil, also when blacklisted. I added an early check on blacklisting status.
With these changes I want to fix the problem described in https://github.com/instacart/makara/issues/258 where lot of connection attempts are performed when primary/replica DBs configuration isn't usable.
I found that
_makara_connection
method tries to establish connection everytime it's called when@connection
isnil
, also when blacklisted. I added an early check on blacklisting status.I also added some unit tests for this method.