curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <>
Subject Re: Is there a way to find which machine holds lease file created by InterProcessSemaphoreMutex
Date Wed, 25 Feb 2015 15:06:56 GMT
You’re getting the data from the parent. It’s the lock/lease nodes that have the data.


On February 25, 2015 at 4:07:48 AM, Jipeng Tan ( wrote:

Thanks for the promptly response.

Can I do this in zookeeper CLI?

Here is my zookeeper directory structure I have:


task-1...n is defined as the root of my task directory.

I believe curator creates two more directories (locks and leases) under task-1...n

I first try yo get payload from the child from locks directory. However, there is no data.

[zk: localhost:2181(CONNECTED) 155] get /blah/TaskLocks/task-1/locks

cZxid = 0x1d301bc1ba
ctime = Thu Feb 19 17:18:30 GMT-07:00 2015
mZxid = 0x1d301bc1ba
mtime = Thu Feb 19 17:18:30 GMT-07:00 2015
pZxid = 0x1e00afb0ff
cversion = 342702
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 0

Did I do something wrong?


On Tue, Feb 24, 2015 at 8:05 PM, Jordan Zimmerman <> wrote:
Unless you change it in the factory, the IP of the instance _is_ stored as the payload for
the lock file. You can getChildren on the lock parent, sort them and get the payload of the
first sorted child.


On February 24, 2015 at 10:58:16 PM, Jipeng Tan ( wrote:


We use InterProcessSemaphoreMutex to make sure certain machine only process certain Task. 

One issue I am currently facing is: sometimes a lease file for one Task presents on Zookeeper,
however, there is no machine process that Task after zookeeper quorum is rebooted.

Since we have hundreds of machines, it is quite hard to go over every machine's log to figure
out which machines own the lease file.

So I wonder if there is a better way to find the association of machines and lease files.
Is that possible to add machines info (IP) to the Lock?


View raw message