This is the behavior we had when we first implemented the API, and in every 
case where people used the information there was a bug. it is virtually 
impossible to use correctly. In general I'm all for giving people rope, but if 
it always results in death, you should stop handing it out.

In your example, if the ACL changed and then the data changed, we would have a 
security hole if we sent the data with the watch.

ben
________________________________________
From: burtona...@gmail.com [burtona...@gmail.com] On Behalf Of Kevin Burton 
[bur...@spinn3r.com]
Sent: Tuesday, January 06, 2009 4:39 PM
To: zookeeper-user@hadoop.apache.org
Subject: Sending data during NodeDataChanged or NodeCreated

So if I understand this correctly, if I receive a NodeDataChanged event, and
then attempt do do a read of that node, there's a race condition where the
server could crash and I would be disconnected and my read would hit an
Exception
Or, the ACL could change and I no longer have permission to read the file
(though I did for a short window).

..... now I have to add all this logic to retry.  Are there any other race
conditions I wonder.

Why not just send the byte[] data during the NodeDataChanged or NodeCreated
event from the server?  This would avoid all these issues.

It's almost certainly what the user wants anyway.

Kevin

--
Founder/CEO Spinn3r.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com

Reply via email to