CondenserDotNet icon indicating copy to clipboard operation
CondenserDotNet copied to clipboard

KeepLeadership can swallow exceptions

Open AzureView opened this issue 4 years ago • 0 comments

If using the leader function we find that there is a problem with the failover.

If have a single instance of service which has aquired the leadership lock, but then kill consul on that server. When subsequently we restart consul the service should reaquire the leadership lock (assuming there was no other instance of the service running which had aquired the lock). However it does not re-aquire the leadership lock.

Similary if have a second instance of the service running which aquires the lock when consul is killed on the server where the instance had originally aquired the lock - then thre is no log message to say the original instance lost the lock.

I believe the issue that needs to be fixe is that any exception in the KeepLeadership loop in LeaderWatcher is swallower and the loop stops. It may need to have try catch similar tot he the watcherLoop in ServiceWatcher.

Thanks Derek

AzureView avatar Jun 02 '21 16:06 AzureView