Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-4461) Turn off caching of loaded system functions #3868

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/puppet/pops/loaders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ def initialize(environment)

# Create the set of loaders
# 1. Puppet, loads from the "running" puppet - i.e. bundled functions, types, extension points and extensions
# Does not change without rebooting the service running puppet.
# These cannot be cached since a loaded instance will be bound to its closure scope which holds on to
# a compiler and all loaded types. Subsequent request would find remains of the environment that loaded
# the content. PUP-4461.
#
@@puppet_system_loader ||= create_puppet_system_loader()
@puppet_system_loader = create_puppet_system_loader()

# 2. Environment loader - i.e. what is bound across the environment, may change for each setup
# TODO: loaders need to work when also running in an agent doing catalog application. There is no
Expand All @@ -30,15 +32,15 @@ def initialize(environment)
#
def self.clear
@@static_loader = nil
@@puppet_system_loader = nil
@puppet_system_loader = nil
end

def static_loader
@@static_loader
end

def puppet_system_loader
@@puppet_system_loader
@puppet_system_loader
end

def public_loader_for_module(module_name)
Expand Down