Issue #4243 has been updated by Brice Figureau.

Priority changed from High to Normal

Markus Roberts wrote:
> Can you walk me through your reasoning?
> 
> Looking at it, it appears to me that the call is coming from within the 
> parser which is already enclosed in the global lock.  In other words, this 
> would be a problem if type_loader were working correctly but, somewhat 
> ironically, isn't actually a problem at present.
> 
> But I could well be wrong.

I don't see where this global lock is set/used. Are you talking about the 
Helper from TypeLoader?
If yes, then you can call import outside from this lock, especially during the 
environment perform_initial_import.

I see maybe the following: 2 clients in the same environment asking for a 
compilation of the same sets of manifests at the same time (and a freshly 
started master).
Both can be in perform_initial_import at the same time, and thus parsing 
site.pp at the same time, and following "import" directives at almost the same 
time.
There can be a thread switch in this code:
<pre>
      unless imported? file
        @imported[file] = true
<< thread switch here >>
        parse_file(file)
      end
</pre>

then, one thread will see the file as imported even though its content hasn't 
been parsed yet.

Reading the TypeLoader code, it looks like only autoloading of manifest is in a 
critical section, and not the site.pp parsing (and all the subsequent manual 
import it does).

Granted, this might be borderline and difficult to trigger, but I'm able to 
trigger it with puppet-test emulating 2 clients on a freshly started master. 
One of the client gets a full blown catalog, and another one gets only a 
partial catalog (I have the json somewhere if you want to have a look).

I've downgraded the severity to Normal.
----------------------------------------
Bug #4243: Multithread issue with manual manifest import
http://projects.puppetlabs.com/issues/4243

Author: Brice Figureau
Status: Needs more information
Priority: Normal
Assigned to: Brice Figureau
Category: compiler
Target version: 2.6.0
Affected version: 2.6.0rc3
Keywords: 
Branch: 


This might be a dup of #4211.

Manually importing a manifest with the "import" function ends up calling 
Puppet::Parser::TypeLoader.import which is not thread-safe (ie it tests and 
sets @imported[file] and parse non atomically).


-- 
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://projects.puppetlabs.com/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