Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9371

Fix the confine caching to work at the provider level instead of the resource-instance level

    XMLWordPrintable

Details

    • Improvement
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Coremunity
    • Needs Assessment

    Description

      Puppet::Confine.valid? ensures that any potentially cached values are reset after each call. We see this pattern in Puppet::Confine::Variable. Unfortunately, valid? is called for each resource instance per https://github.com/puppetlabs/puppet/blob/16220673acaa03f708f6b6410a659b4ba737ab7a/lib/puppet/graph/relationship_graph.rb#L115-L116 and https://github.com/puppetlabs/puppet/blob/16220673acaa03f708f6b6410a659b4ba737ab7a/lib/puppet/confiner.rb#L43-L45 so this would mean that cached values would get reset for every resource instance. Thus, they would not persist at the provider level (technically the provider-class level), which is undesirable and defeats the purpose of caching.

      We should re-architect how caching works for confinements so that it persists for the entire transaction instead of on every valid? call (i.e. instead of on a per-resource case).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              enis.inan Enis Inan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support