zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: Dealing with an expired session
Date Wed, 27 Jun 2012 17:54:49 GMT
On Tue, Jun 26, 2012 at 1:25 PM, David Nickerson
<davidnickerson4mailinglists@gmail.com> wrote:
> Is there any guarantee of order? For example, does the default watcher
> receive the notification first?
>

No, no guarantee.

Patrick

> On Tue, Jun 26, 2012 at 11:35 AM, Rakesh R <rakeshr@huawei.com> wrote:
>
>> When the ZK disconnects/synconnects/expires all the watchers will get the
>> notifications. I think, you should have the KeeperState checks in the
>> respctive watchers and can do the thread handling logics.
>> ________________________________________
>> From: David Nickerson [davidnickerson4mailinglists@gmail.com]
>> Sent: Tuesday, June 26, 2012 8:20 PM
>> To: ZooKeeper mailing list
>> Subject: Dealing with an expired session
>>
>> In my locking implementation, if a thread wants to wait for a lock, it will
>> create a watcher object, set a watch on the lock before it, and wait on the
>> watcher. When the watch gets triggered, the watcher notifies any threads
>> that are waiting on it.
>>
>> If the session expires, I would like to wake up all of the threads that are
>> waiting for a lock. To my understanding, only the default watcher receives
>> a notification that the session has expired. If this is the case, then I
>> need to maintain a list somewhere of all of the watchers that threads are
>> waiting on so that I can notify them all.
>>
>> Does this sound correct?
>>

Mime
View raw message