puppetlabs/puppet — pull request #2080 by ffrank (2013-11-16 23:42:33+00:00)
Title: (#17210) allow the aggressive re-parsing of functions in modules

Here's a simple solution for the problems with dynamically changed functions in modules, or functions that are different in different environments.

The trouble is that a ruby process will hold on to a loaded implementation. The implications can be drastic, e.g. an agent in the production environment may receive a catalog resulting from the compilation by a master process that loaded one or more functions from a development environment earlier.

My approach to keep this from happening: Have the master clear its record of loaded functions before each compiler run. The functions in modules must then be reloaded. This is costly, and possibly dangerous when threading. Therefor, add a new master option (--gratuitous_function_parsing) that defaults to false. The new behavior must be expressly selected.