msemys / esjc

EventStore Java Client
MIT License
108 stars 27 forks source link

Fix multiple reconnects at the same time #43

Closed daMupfel closed 5 years ago

daMupfel commented 5 years ago

This fix should prevent multiple reconnects happening at the same time. We encountered that if you manually connect and open a query around the same time (in a cluster config) that multiple re-connections where scheduled at the same time (finding best eventstore ... 1/10).

There is a check in the "discoverEndpoint" method that checks if the phase is RECONNECTING which did not make any sense before since we always set it to RECONNECTING right before the check here.

Regards David.

lbodor commented 5 years ago

I've just encountered this issue as well.