The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #17210

Updated functions are not reloaded within a worker process

Added by Erik Dalén over 3 years ago. Updated over 2 years ago.

Status:In Topic Branch Pending ReviewStart date:
Priority:HighDue date:
Assignee:-% Done:

0%

Category:compiler
Target version:-
Affected Puppet version:3.0.1 Branch:https://github.com/puppetlabs/puppet/pull/2080
Keywords:function loading compiler scope customer

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PUP-1033


Description

If a custom function is updated in an environment the workers will continue to use the old version if they had that loaded already. So with multiple passenger workers you get a situation where some puppet runs use the old version of the function and some use the new version, but all use the new versions of the manifest code.

To solve this the scope instance for the environment should probably be destroyed after each compilation so the new versions are always loaded in on a new compile. Or just delete the functions from the object.


Related issues

Related to Puppet - Bug #12173: Masters cannot reliably distinguish between multiple vers... Accepted 01/25/2012
Related to Puppet - Bug #8750: puppetmaster needs restart to pick up on changes in types... Duplicate 08/03/2011
Related to Puppet - Bug #18042: Deprecate face versions Accepted

History

#1 Updated by Anonymous over 3 years ago

I haven’t tried this out, but would the basic repro steps be:

  1. Setup puppet in passenger with a limit of a single child process.
  2. Write a module that has a function
  3. Compile a catalog that uses that function
  4. Modify the function
  5. Compile a catalog again that uses the function

Expect that the second catalog compilation uses the modified function.

Actually get that the second catalog compilation uses the original function.

#2 Updated by Erik Dalén over 3 years ago

Yes exactly, that should reproduce the issue.

#3 Updated by Erik Dalén over 3 years ago

It should probably be noted that this is not a new issue in 3.0.1 but has existed for a long time. I don’t have time to go back and see when it first appeared though.

#4 Updated by Josh Cooper over 3 years ago

  • Status changed from Unreviewed to Accepted

if functions require utility code, then deleting the functions or regenerating a scope object for each compile won’t be sufficient, as we could get newer functions and older utility code. Really, we need to compile in a separate process to ensure environments are isolated. See also http://projects.puppetlabs.com/issues/4248#note-29

#5 Updated by Stijn Hoop over 3 years ago

Is this related to my report in #8750 ?

#6 Updated by Erik Dalén over 3 years ago

Stijn Hoop wrote:

Is this related to my report in #8750 ?

Yes, it is probably related but they are loaded with slightly different mechanisms so it probably makes sense to keep it as two separate bug reports.

#7 Updated by Anonymous almost 3 years ago

  • Priority changed from Normal to High
  • Keywords changed from function loading compiler scope to function loading compiler scope customer

#9 Updated by Felix Frank over 2 years ago

I agree. This particular problem may be easier to fix. I’m working on a pragmatic solution in https://github.com/ffrank/puppet/tree/ticket/master/17210-reload-functions.

Will add some tests and open a PR. Let’s see what people think.

Erik Dalén wrote:

Stijn Hoop wrote:

Is this related to my report in #8750 ?

Yes, it is probably related but they are loaded with slightly different mechanisms so it probably makes sense to keep it as two separate bug reports.

#10 Updated by Felix Frank over 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/2080

Pull request is open.

#11 Updated by Stephen Gelman over 2 years ago

  • Branch changed from https://github.com/puppetlabs/puppet/pull/2080 to https://github.com/puppetlabs/puppet/pull/2081

Sorry, wrong ticket…

#12 Updated by Felix Frank over 2 years ago

  • Branch changed from https://github.com/puppetlabs/puppet/pull/2081 to https://github.com/puppetlabs/puppet/pull/2080

I don’t think so ;–)

Wrong ticket.

#13 Updated by Erik Dalén over 2 years ago

Redmine Issue #17210 has been migrated to JIRA:

https://tickets.puppetlabs.com/browse/PUP-1033

Also available in: Atom PDF