0

I have a requirement where there are 2 instances of the application on different DCs running. It uses distributed locks so at any given point of time only 1 instance will have the lock. So say instance A has the lock but while running some critical section it loses the lock but it does not know about it so instance B gets the lock. So now before updating the DB instance A checks if it has the lock or not if it does not have the lock it is suppose to exit. I am not sure what is the bets way to handle the exit. I cant just return coz the flow of the code will continue. I was thinking System.exit and then since we use mesos it will start the instance again but wanted to see if there is a better way to handle it.

Sachin Jain
  • 97
  • 1
  • 10

0 Answers0