shayshim commented on a change in pull request #315: [CURATOR-530]
Documentation on InterProcessSemaphoreMutex is misleading
URL: https://github.com/apache/curator/pull/315#discussion_r302164607
##########
File path:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessLock.java
##########
@@ -44,7 +44,7 @@
/**
* Perform one release of the mutex.
*
- * @throws Exception ZK errors, interruptions, current thread does not own
the lock
+ * @throws Exception ZK errors, interruptions
Review comment:
On the one hand it seems true that not all implementations throw exception
in case of different thread, on the other hand, after removing this comment
from the interface - its users cannot be aware of the possibility that this
exception can be thrown (depending on the implementation). So user that did not
create this InterProcessLock, but calls release() from different thread, might
be surprised of the IllegalMonitorStateException (in case it is
InterProcessMutex, for instance).
Maybe add above the interface InterProcessLock top level javadoc (empty
currently):
NOTE: depending on its implementation, InterProcessLock#release() might
throw exception if current thread does not own the lock
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services