Issue #21201 has been updated by Andrew Parker.

Brice Figureau wrote:
> Well, the puppet master runs fine under a threaded JRuby based server (or at 
> least it was around 2.7.x). I'm not aware of JRuby production use out there, 
> but before breaking this compatibility you might first ask on the mailing 
> list. To my knowledge the JRuby solution is a great way (though not supported 
> by PL) to scale a master.
>  

Based on the state of the code that I've seen, I think it is much more that it 
"appears" to work in a threaded environment than it really does work. There are 
far too many subtle problems in the code around shared state for this to be a 
supportable way of operating. Also, I wouldn't consider it breaking 
compatibility if it isn't an explicitly supported way of running the master.

> I also understand that the code you're mentioning is a mess and I'm certainly 
> one of the culprit. 
> 
> Now, I think there are ways to keep threading-support and still share most of 
> the internal data structure while at the same time reducing the code 
> complexity, for instance fully immutable structures might help.

That is definitely the way to go. Share as little as possible and communicate 
only through known channels. However, that is a larger change and one in which 
I think we are better off backing out of the synchronization code and then 
refactoring/redesigning/rewriting moving forward to achieve. Generally I go for 
a "simplify then solve the true problems that remain" approach.


----------------------------------------
Refactor #21201: Remove "thread safety" code from puppet
https://projects.puppetlabs.com/issues/21201#change-93390

* Author: Andrew Parker
* Status: Accepted
* Priority: Normal
* Assignee: eric sorenson
* Category: 
* Target version: 3.3.0
* Affected Puppet version: 
* Keywords: backlog
* Branch: 
----------------------------------------
The puppet master does not run in threaded environments. Even our use of 
webrick avoids threads (see 
<https://github.com/puppetlabs/puppet/blob/3251ebd2a08ab483d5a74f0e8950e4536f477e48/lib/puppet/network/http/webrick.rb#L31-L37>).
 However, there are large amounts of code and convoluted constructs dedicated 
to trying (and most likely failing) to make various subsystems in puppet 
thread-safe.

This extra code has multiple down-sides:

  * False sense of security that you can safely use puppet in a threaded 
environment
  * Hard to understand code and high WTF/second count that slows down 
development
  * Possible locking overhead at runtime that is not needed

I can't think of any upside to keeping these structures around.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to