The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
Updated functions are not reloaded within a worker process
|Status:||In Topic Branch Pending Review||Start date:|
|Affected Puppet version:||3.0.1||Branch:||https://github.com/puppetlabs/puppet/pull/2080|
|Keywords:||function loading compiler scope customer|
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.
#1 Updated by Anonymous over 3 years ago
I haven’t tried this out, but would the basic repro steps be:
- Setup puppet in passenger with a limit of a single child process.
- Write a module that has a function
- Compile a catalog that uses that function
- Modify the function
- 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.
#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
#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.