On Jul 23, 2010, at 10:40 AM, Brice Figureau wrote:

On 23/07/10 18:49, Joe McDonagh wrote:
On 07/23/2010 12:31 PM, James Turnbull wrote:
Signed-off-by: James Turnbull<[email protected]>
---
ext/extlookup.rb |    2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ext/extlookup.rb b/ext/extlookup.rb
index d87583b..81e6a4b 100644
--- a/ext/extlookup.rb
+++ b/ext/extlookup.rb
@@ -125,6 +125,8 @@ module Puppet::Parser::Functions

    desired = "_ExtUNSET_"

+    parser = Puppet::Parser::Parser.new(environment)
+
    datafiles.each do |file|
      parser.watch_file(file) if File.exists?(file)


I would like to know if there is some kind of explanation as to why this
is now needed? I have another custom plugin that exhibits the same
behavior extlookup does without this line- the master just hangs.

I guess that someone removed the parser accessor from the Scope class,
to remove the clutter (functions are defined in the Scope instance).

Parsers used to be non-transient - we created one on startup and always used the same instance everywhere (except when reparsing), and everyone had a reference to one.

As we promoted the importance of the ResourceTypeCollection class -- it now keeps the list of known resource types, instead of the Parser doing so -- the need for everyone having a Parser reference went away. Or rather, we used to keep references to parsers around because they kept references to a LoadedCode instance; we s/LoadedCode/ ResourceTypeCollection/ and promoted it so people just reference it directly. And now the Environment instances own the references to this new class.

And thus, Parser instances are transient, so you generally can't get a reference to one.

--
There are no such things as applied sciences, only applications of
science. -- Louis Pasteur
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to