> >> brice:tickets/0.25.x/3396 (Faster event propagation) succeeded:

> >         >     * 7c3cd8c Fix inefficient SimpleGraph#matching_edge
> >         >     7771 examples, 28 failures, 41 pending
> >         >         4 more in unit/simple_graph.rb (4 total)
> >
> >
> >         This is not good. Looks like we are missing Luke's glue event
> >         patch, or
> >         there is something at play here.
> >
> > The event-->events patch appears to be there; the problem appears to
> > be with the event.source patch (all of the errors look like this):
>
> That's what I was thinking.
>
> But I also remember Luke saying:
> > On Mar 21, 2010, at 9:50 AM, Brice Figureau wrote:
> > > I explored Lak's repositories and found that event.source was
> > renamed
> > > into event.resource (apparently).
> >
> > Something like that - it looks like that should work for the
> > purposes
> > of this, although I'd definitely test it.  I think for most cases
> > both
> > the resource and property will be set (to strings), but I think
> > there
> > are some cases where just the source_description is set.  For some
> > reason I've made 'log_source' a private method; this would probably
> > actually be the best thing to use, since it picks the best value.
>
> So, I'm puzzled: we lost event.source, and got event.resource instead
> that is a string (ie a resource ref and not an resource instance
> anymore), so clearly my patch can't work directly (it needs resource
> instances).
>

This seems to have been lost in the merge; but the line that appears to have
been lost:

        source = base || event.resource

leads to odd transformations when translated to the present code (e.g. right
after your branch is merged into testing):

diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb
index 37a08e7..9c04a32 100644
--- a/lib/puppet/simple_graph.rb
+++ b/lib/puppet/simple_graph.rb
@@ -158,11 +158,11 @@ class Puppet::SimpleGraph
         if base
             # consider only edges which are not pointing to any event
sources
             # which is what a recursive file resources produces
-            event_sources = events.inject({}) { |hash, event|
hash[event.source] = event.source ; hash}
-            edges = (adjacent(base, :direction => :out, :type => :edges) -
event_sources.keys)
+            event_sources = {base => base}
+            edges = (adjacent(base, :direction => :out, :type => :edges) -
[base])
         else

In the if-base clause, source would always == base, and walking that fact
through leads to code that I suspect must be wrong.

-- Markus

-- 
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