hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Robertson <timrobertson...@gmail.com>
Subject Re: Lock example
Date Tue, 14 Sep 2010 05:25:06 GMT
Thanks Mahadev,

It's good for this confirmation as this is what I ended up doing.


On Mon, Sep 13, 2010 at 11:33 PM, Mahadev Konar <mahadev@yahoo-inc.com> wrote:
> Hi Tim,
>  The lock recipe you mention is supposed to avoid her affect and prevent starvation
(though it has bugs :)).
>  Are you looking for something like that or just a simple lock and unlock that doesn't
have to worry abt the above issues.
> If that's the case then just doing an ephemeral create and delete should give you your
lock and unlock recipes.
>
>
> Thanks
> mahadev
>
>
> On 9/8/10 9:58 PM, "Tim Robertson" <timrobertson100@gmail.com> wrote:
>
> Hi all,
>
> I am new to ZK and using the queue and lock examples that come with
> zookeeper but have run into ZOOKEEPER-645 with the lock.
> I have several JVMs each keeping a long running ZK client and the
> first JVM (and hence client) does not respect the locks obtained by
> subsequent clients - e.g. the first client always manages to get the
> lock even if another client holds it.
>
> Before I start digging, I thought I'd ask if anyone has a simple lock
> implemented they might share?  My needs are simply to lock a URL to
> indicate that it is being worked on, so that I don't hammer my
> endpoints with multiple clients.
>
> Thanks for any advice,
> Tim
>
>

Mime
View raw message