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

Cache parsed YAML and JSON with environment life-cycle.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.3
    • Fix Version/s: PUP 4.9.4
    • Component/s: None
    • Labels:
    • Template:
    • Acceptance Criteria:
      Hide
      1. A YAML or JSON file that does not change, is only parsed once throughout the life-cycle of an environment.
      2. A YAML or JSON file that does change, is reloaded and reparsed, even though the environment is still active.
      3. The hiera.yaml is cached using the same mechanism.
      Show
      A YAML or JSON file that does not change, is only parsed once throughout the life-cycle of an environment. A YAML or JSON file that does change, is reloaded and reparsed, even though the environment is still active. The hiera.yaml is cached using the same mechanism.
    • Team:
      Puppet Developer Experience
    • Story Points:
      2
    • Sprint:
      PDE 2017-03-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      A regression in hiera 5 was found where parsed hiera data files were not cached. Now they are.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      perf; covered by unit benchmarks and tests

      Description

      Parsing YAML and JSON files is a slow process and classic Hiera used a FileCache class that would store the parsed result indefinitely but discard it in case the inode, mtime, or size of the source file changed.

      Hiera 5 must have a similar cache and it should share the environment life-cycle rather than being indefinite. The cache should be made available to a data provider function in a similar way that the classic Hiera does. By using a method on the Context that takes the path as an argument and expects a block to produce the parsed result for caching. The block is then only called when the file has changed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                thomas.hallgren Thomas Hallgren
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support