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

Cache parsed YAML and JSON with environment life-cycle.

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • PUP 4.9.3
    • PUP 4.9.4
    • None
    • 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.
    • Puppet Developer Experience
    • 2
    • PDE 2017-03-08
    • Bug Fix
    • A regression in hiera 5 was found where parsed hiera data files were not cached. Now they are.
    • No Action
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support