curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [curator] shayshim commented on a change in pull request #315: [CURATOR-530] Documentation on InterProcessSemaphoreMutex is misleading
Date Wed, 10 Jul 2019 16:39:26 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message