zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Capriolo <edward.capri...@huffingtonpost.com>
Subject Bug with ZKWriteLock recipe
Date Fri, 30 Jan 2015 20:28:12 GMT
http://svn.apache.org/repos/asf/zookeeper/trunk/src/recipes/lock/src/java/org/apache/zookeeper/recipes/lock/

So there is a bug in the above code ( I think)

WARN 10:08:31,468 attempting to unlock x-93233511378059273-0000000002
DEBUG 10:08:31,468 234f44a4-7f6e-4f19-962b-fb9a7b64f6c4 released
WARN 10:08:31,469 Unable to unlock/cleanup. hadlock?false
java.lang.IllegalArgumentException: Path must start with / character
at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:51)
at org.apache.zookeeper.ZooKeeper.delete(ZooKeeper.java:846)
at org.apache.zookeeper.recipes.lock.WriteLock$1.execute(WriteLock.java:120)
at org.apache.zookeeper.recipes.lock.WriteLock.unlock(WriteLock.java:124)
at io.teknek.daemon.TeknekDaemon.considerStarting(TeknekDaemon.java:277)
at io.teknek.daemon.TeknekDaemon.access$4(TeknekDaemon.java:211)
at io.teknek.daemon.TeknekDaemon$2.run(TeknekDaemon.java:126)

The bug seems to be if the latch is not acquired unlock gets the from path.

https://github.com/edwardcapriolo/teknek-core/commit/747174f7b04a570e13583542a9e7ef3029f7bcf6

Basically with two concurrent users of the lock you see this quite often.

Q.Theses lock recipes seem a bit crude...no offense... I can send a patch.
But I wonder if no one is maintaining these maybe they should be removed
(and curator recipes) suggested instead.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message