Issue #2294 has been updated by Markus Roberts.

File race_patch added

The attached patch should fix the race condition; it extends the loading logic 
so that: 
* initial load attempts are processed (as before), 
* recursive load attempts return immediately (as before), 
* but subsequent _concurrent load attempts_ from different threads wait on a 
semaphore (condition variable) and then retry (e.g. use the now-valid results 
of the first thread).

This is a slight modification of the solution I'd originally proposed, to 
prevent a deadlock that could have arisen if three or more threads 
simultaneously attempted to load the same item.

Though it solves the bug as reported, it has room for improvement:
* Failures aren't cached, so repeated attempts will be made to import invalid 
items each time they are encountered
* It doesn't address any of the underlying referential ambiguity (module vs. 
filename)
* The threading logic should probably be refactored into a separate class (as a 
start I encapsulated it in an ad hoc singleton class, so at least it isn't 
cluttering up the load method)

----------------------------------------
Bug #2294: Classes sometimes cannot be found
http://projects.reductivelabs.com/issues/2294

Author: Luke Kanies
Status: Accepted
Priority: Normal
Assigned to: Markus Roberts
Category: language
Target version: 0.25.0
Complexity: Unknown
Affected version: 0.25.0beta1
Keywords: 


This kind of error occurs multiple times over the course of a week at a client 
of mine:
<pre>
puppetmasterd err puppetmasterd[11913]: Could not find class allusers::charles 
in namespaces allusers::sss at /etc/puppet/modules/allusers/manifests/sss.pp:15 
on node d3i002.view.domain.com
</pre>
I believe it is the result of some kind of race condition or timeout, as I've 
been able to force it to happen under load, but only then.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to