On 30/09/10 22:48, Jason Wright wrote:
> On Thu, Sep 30, 2010 at 11:41 AM, Brice Figureau
> <[email protected]> wrote:
>> It should fix the 1) issue outlined above. I don't think it is the root
>> cause of your issue, but that's the best I could think about :(
>> So let's try if that fixes it, we might be lucky today :)
>
> This doesn't seem to help. :(
Yes this was improbable.
Can you try the following debug patch on the master.
You need to run it with --debug --trace, and then send me the log extract which
appears before the stacktrace of the failure (make sure to send enough :)).
I hope to be able to understand the access patterns.
diff --git a/lib/puppet/util/file_locking.rb b/lib/puppet/util/file_locking.rb
index 8b194ed..2af01fc 100644
--- a/lib/puppet/util/file_locking.rb
+++ b/lib/puppet/util/file_locking.rb
@@ -6,11 +6,20 @@ module Puppet::Util::FileLocking
# Create a shared lock for reading
def readlock(file)
raise ArgumentError, "#{file} is not a file" unless !File.exists?(file) or
File.file?(file)
+ Puppet.debug("Thread #{Thread.current} readlocking #{file}")
Puppet::Util.sync(file).synchronize(Sync::SH) do
+ Puppet.debug("Thread #{Thread.current} synchronized #{file}")
File.open(file) { |f|
- f.lock_shared { |lf| yield lf }
+ Puppet.debug("Thread #{Thread.current} opened #{file}")
+ f.lock_shared { |lf|
+ Puppet.debug("Thread #{Thread.current} lock_shared #{file}")
+ yield lf
+ }
+ Puppet.debug("Thread #{Thread.current} unlock_shared #{file}")
}
+ Puppet.debug("Thread #{Thread.current} closed #{file}")
end
+ Puppet.debug("Thread #{Thread.current} out of sync #{file}")
end
# Create an exclusive lock for writing, and do the writing in a
@@ -33,12 +42,19 @@ module Puppet::Util::FileLocking
end
end
+ Puppet.debug("Thread #{Thread.current} writelocking #{file}")
Puppet::Util.sync(file).synchronize(Sync::EX) do
+ Puppet.debug("Thread #{Thread.current} synchronized exclusive #{file}")
File.open(file, "w", mode) do |rf|
+ Puppet.debug("Thread #{Thread.current} opened for write #{file}")
rf.lock_exclusive do |lrf|
+ Puppet.debug("Thread #{Thread.current} locked exclusively #{file}")
yield lrf
end
+ Puppet.debug("Thread #{Thread.current} unlocked exclusively #{file}")
end
+ Puppet.debug("Thread #{Thread.current} closed(w) #{file}")
end
+ Puppet.debug("Thread #{Thread.current} unshynchronized #{file}")
end
end
--
Brice Figureau
My Blog: http://www.masterzen.fr/
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.