diff options
| author | Markus Roberts <Markus@reality.com> | 2011-04-04 12:13:53 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2011-04-06 16:26:57 -0700 |
| commit | 2a6c6cb8fabf82d2f2127c90db670c1a856427c5 (patch) | |
| tree | 70dfb4300a4832d0edb1fdeab265b457e56f31a5 /lib/puppet/transaction | |
| parent | 5dc994c594680203a4bbbbaa3d6f3b00640c1530 (diff) | |
| download | puppet-2a6c6cb8fabf82d2f2127c90db670c1a856427c5.tar.gz puppet-2a6c6cb8fabf82d2f2127c90db670c1a856427c5.tar.xz puppet-2a6c6cb8fabf82d2f2127c90db670c1a856427c5.zip | |
(5200) -- replace containers with sentinals
This commit removes the last remaining use of topsort (in SimpleGraph#splice!) by
fixing #5200 in a way that is compatible with graph fontiers. Instead of replacing
containers with many-to-many relationships, we now replace them with a pair of
sentinals (whits) that bracket them.
Thus a graph consisting of two containers, each containing ten resources, and a
dependency between the containers, which would have gone from 21 edges to 100
edges will instead have only 43, and a graph consisting of two containers (e.g.
stages) each containing a similar graph, which would have gone from 45 edges to
400 will only go to 95.
This change had minor consequences on many parts of the system and required lots
of small changes for consistancy, but the core of it is in Catelog#splice! (which
replaces SimpleGraph#splice!) and Transaction#eval_generate. Everything else is
just adjustments to the fact that some one-step edges are now two-step edges and
tests, event propagation, etc. need to reflect that.
Paired-with: Jesse Wolfe
Diffstat (limited to 'lib/puppet/transaction')
| -rw-r--r-- | lib/puppet/transaction/event_manager.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb index 3ebb0a9d3..a21bbf892 100644 --- a/lib/puppet/transaction/event_manager.rb +++ b/lib/puppet/transaction/event_manager.rb @@ -31,7 +31,7 @@ class Puppet::Transaction::EventManager # Queue events for other resources to respond to. All of these events have # to be from the same resource. def queue_events(resource, events) - @events += events + #@events += events # Do some basic normalization so we're not doing so many # graph queries for large sets of events. @@ -47,12 +47,15 @@ class Puppet::Transaction::EventManager # Collect the targets of any subscriptions to those events. We pass # the parent resource in so it will override the source in the events, # since eval_generated children can't have direct relationships. + received = (event.name != :restarted) relationship_graph.matching_edges(event, resource).each do |edge| + received ||= true unless edge.target.is_a?(Puppet::Type::Whit) next unless method = edge.callback next unless edge.target.respond_to?(method) queue_events_for_resource(resource, edge.target, method, list) end + @events << event if received queue_events_for_resource(resource, resource, :refresh, [event]) if resource.self_refresh? and ! resource.deleting? end |
