HomePhorge

(#11641) Properly track blockers when generating additional resources
ca7328323ab9Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#11641) Properly track blockers when generating additional resources

Previously, we would enqueue any unblocked resources as we added them to the
graph. These were our initial resources, with no dependencies, and served as a
starting place for traversal. However, we would
add_dynamically_generated_resources before traversing, which could add
additional resources and dependencies. We never accounted for these, causing
our measure of blockedness to become incorrect (a resource could have more
dependencies than we counted).

This is similar to the case of eval_generate adding additional resources. In
that case, we clear the blockers list and allow it to be recalculated on
demand. Unfortunately, that approach doesn't work for the case where we add
resources before traversing (as in add_dynamically_generated_resources),
because we wouldn't have a reliable list of resources to begin traversal with.
Now we no longer enqueue resources when adding them, and instead wait until
after we have called add_dynamically_generated_resources (which happens only
once). This allows us to add our root resources with the assurance they won't
change before we start evaluating them.

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU399e923f790b: Merge pull request #170 from xaque208/7296
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Lewis <nick@puppetlabs.com> committed rPUca7328323ab9: (#11641) Properly track blockers when generating additional resources (authored by Nick Lewis <nick@puppetlabs.com>).Dec 31 2011, 12:03 AM