Issue #4211 has been updated by Brice Figureau.

Brice Figureau wrote:
> Markus Roberts wrote:
> > We've fixed the overt bugs, but the performance implications (and perhaps 
> > more subtle bugs) warrant further exploration of this code.
> 
> in current master (as of 91185c6c04dc2bb5659db8f7a7d23a41c4d308ea) when using 
> 2 clients hitting the same freshly started master (ie nothing parsed yet), 
> one of the client gets an almost empty catalog, while the other gets the full 
> catalog.
> 
> Both clients requests the same node catalog. 
> 
> This is 100% reproducible with puppet-test --fork 1 (my puppet-test version 
> that asks for remote REST catalogs).
> 
> My gut feeling is that, both threads starts parsing the same set of 
> manifests, but at one time one sets a flags saying that everything is parsed 
> (while it is not), so the other thinks everything is ready but gets an 
> incomplete AST. It looks like we need a critical section around individual 
> manifests parsing/importing.

In fact the issue is that the auto-loading is protected (through the use of 
import_if_possible), but if you manually load a manifest through the import 
function you end up directly loading with the following not-thread-safe code:
<pre>
def import
...
      unless imported? file
        @imported[file] = true
        parse_file(file)
      end
...
end
</pre>

If a thread sets @imported[file] and is preempted during parse_file another 
thread calling the same import directly (not the result of auto-loading) will 
think the manifest is imported. It might even see a partial or incomplete AST 
in the end.
 
----------------------------------------
Refactor #4211: Investigate the changes made in the type_loader extraction
http://projects.puppetlabs.com/issues/4211

Author: Markus Roberts
Status: Investigating
Priority: High
Assigned to: Markus Roberts
Category: threading
Target version: queued
Affected version: 2.6.0rc1
Branch: 


There were a number of structural changes made in the type_loader extraction; 
one of them caused multi-threaded loading to fail outright; the others ought to 
be examined in more detail.



-- 
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