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

hiera_include doesn't work when using environment catalogs and environment caching

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: PUP 4.6.1
    • Fix Version/s: PUP 4.6.2
    • Component/s: Language
    • Labels:
    • Template:
    • Acceptance Criteria:
      Hide

      That the override of hiera_include in the environment compiler works also when an environment is cached, and when the environment has been in use for regular compilations before an environment compilation.

      Show
      That the override of hiera_include in the environment compiler works also when an environment is cached, and when the environment has been in use for regular compilations before an environment compilation.
    • Story Points:
      1
    • Sprint:
      Language 2016-09-07
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Puppet 4.6.1 introduced a regression in the fix of PUP-6608 that affected the environment compiler used in application orchestration as it needs an override of the function {{hiera_include}} to ignore calls to that function. Due to functions now (in Puppet 4.6.1) being cached in the environment, the mechanism used to override the function would not always work, and when succeeding would disrupt regular compilations. This is now fixed.
      Show
      Puppet 4.6.1 introduced a regression in the fix of PUP-6608 that affected the environment compiler used in application orchestration as it needs an override of the function {{hiera_include}} to ignore calls to that function. Due to functions now (in Puppet 4.6.1) being cached in the environment, the mechanism used to override the function would not always work, and when succeeding would disrupt regular compilations. This is now fixed.

      Description

      To address PUP-6527, the environment compiler pre-defines a non-functional version of hiera_include at the start of compilation. This causes the "real" version, which will fail if used during environment compilation, to never be loaded. However, now that loaders are cached between compilations, there are a couple of serious issues with this behavior:

      • Environment catalog requests will fail if hiera_include is already present in the loader

      For subsequent environment catalog requests, hiera_include has already either been loaded (if the previous request was for an agent catalog using hiera_include) in the loader or has been pre-loaded as a stub. Our attempt to explicitly define it causes a hard error, because it's a redefinition. This happens whether hiera_include is being used or not; multiple environment catalog requests will always fail if environment caching is enabled.

      • hiera_include is non-functional during agent catalog requests following an environment catalog request

      If the first request for a given process is for an environment catalog, a noop version of hiera_include is created. It will then persist through the lifetime of the environment cache, causing hiera_include in agent catalogs to do nothing. This happens with puppet job run, for instance.

      The breaking change was introduced in 4.6.1 in commit 95ff24739ce85c3b7ca5ca1bffee9247c0cc2c5e.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  qa qa
                  Reporter:
                  nick Nick Lewis
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  11 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support