You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by "kulkarni.swarnim@gmail.com" <ku...@gmail.com> on 2013/11/21 16:53:06 UTC

Question about InterProcessReadWriteLock

Hello,

So we are using InterProcessReadWriteLock[1] to get a distributed lock on a
file on HDFS to prevent concurrent modifications. However in very rare
cases (1 in 100), we see that the file does get touched at the same time
causing corruption of the file. I was wondering what could be causing this.
We are currently using 1.1.3 version of curator-recipes. Also another thing
to note is that currently we have not implemented the
ConnectionStateListener. Could that be a possible reason for this behavior?
Or is there a bug in curator somewhere for this version which might be
causing this?

Any help would be much appreciated.

Thanks,

Swarnim

[1]
http://curator.apache.org/apidocs/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.html

Re: Question about InterProcessReadWriteLock

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
A few things:

* You should update to the latest (Apache) version

* You MUST implement a ConnectionStateListener and watch for connection problems. See: http://curator.apache.org/errors.html

-Jordan

On Nov 21, 2013, at 7:53 AM, kulkarni.swarnim@gmail.com wrote:

> Hello,
> 
> So we are using InterProcessReadWriteLock[1] to get a distributed lock on a file on HDFS to prevent concurrent modifications. However in very rare cases (1 in 100), we see that the file does get touched at the same time causing corruption of the file. I was wondering what could be causing this. We are currently using 1.1.3 version of curator-recipes. Also another thing to note is that currently we have not implemented the ConnectionStateListener. Could that be a possible reason for this behavior? Or is there a bug in curator somewhere for this version which might be causing this?
> 
> Any help would be much appreciated.
> 
> Thanks,
> 
> Swarnim
> 
> [1] http://curator.apache.org/apidocs/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.html
>