Catch exception from ServiceLock.deleteLocks when no servers#6192
Catch exception from ServiceLock.deleteLocks when no servers#6192dlmarion merged 2 commits intoapache:2.1from
Conversation
|
Part of me wonders if the method that delete the locks should not throw an IlegalStateException when there are no servers and just return instead. |
|
Not sure why its throwing an exception for zero servers. If the dirs created by init are not there then may that could throw an exception. |
ddanielr
left a comment
There was a problem hiding this comment.
Not sure why its throwing an exception for zero servers. If the dirs created by init are not there then may that could throw an exception.
I'll look at the code I refactored. I agree that missing locks shouldn't resulting in a IllegalStateException.
I'm betting that's supposed to be a top level check for the dir path.
I could understand an illegal state exception when trying to delete locks for a group path that doesn't exist.
The methods in ServiceLock that delete locks throw an IllegalStateException when there are no servers in ZooKeeper at the specified path. This change catches those exceptions when it's not an error condition.