[Gluster-devel] Problems with flock functionality with fuse-2.7.0-gls3 and tls 450

Raghavendra G raghavendra.hg at gmail.com
Fri Aug 10 05:03:08 UTC 2007


Hi all,
Just an update.

With fuse-2.4.2 kernel module and fuse-2.6.3 libfuse.so, the above program
runs without problems.

On 8/10/07, Harris Landgarten <harrisl at lhjonline.com> wrote:
>
> I ran the following ruby program named testlock.rb:
>
> #!/usr/bin/ruby
>
> class File
>   def File.open_locked(*args)
>     File.open(*args) do |f|
>       begin
>         f.flock(File::LOCK_EX)
>         result = yield f
>       ensure
>         f.flock(File::LOCK_UN)
>         return result
>       end
>     end
>   end
> end
>
> file = ARGV.shift || "./testlockfile"
> delay = ARGV.shift || 10
> hostname = `hostname`
> hostname.chomp!
> puts "opening #{file} and locking"
> File.open_locked(file, "w"){ |f| f.puts "test"; puts "#{Time.now} :
> locking file"; sleep delay.to_i; f.puts "finished" }
> puts "#{file} #{hostname} end #{Time.now}"
> puts "#{file} #{hostname} unlocked"
>
> When run on the local file system as:
>
> $ ruby ./testlock.rb testfile 60
>
> I ran another instance on the same client and it blocked until the first
> instance released the LOCK_EX and then completed.
>
> The same test was run on gluster as:
>
> $ ruby ./testlock.rb /mnt/glusterfs/testfile 60
>
> When another instance was started:
>
> $ ruby ./testlock.rb /mnt/glusterfs/test/testfile
> opening /mnt/glusterfs/test/testfile and locking
> ./testlock.rb:6:in `initialize': No such file or directory -
> /mnt/glusterfs/test/testfile (Errno::ENOENT)
>         from ./testlock.rb:6:in `open'
>         from ./testlock.rb:6:in `open_locked'
>         from ./testlock.rb:24
>
> Glusterfs is reporting the LOCK_EX file as ENOENT when another LOCK_EX is
> requested instead of blocking.
>
> Harris
>
>
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> http://lists.nongnu.org/mailman/listinfo/gluster-devel
>



-- 
Raghavendra G



More information about the Gluster-devel mailing list