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

metadata.json is parsed twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.10.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-01-25, PDE 2017-02-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The metadata.json in each module was parsed multiple times and the logic involved an extra check for existance of the metadata.json file. This is now changed. This will have a small positive impact on performance in large environments with many modules and in virtual environments as it reduces the number of calls to 'stat'.
      Show
      The metadata.json in each module was parsed multiple times and the logic involved an extra check for existance of the metadata.json file. This is now changed. This will have a small positive impact on performance in large environments with many modules and in virtual environments as it reduces the number of calls to 'stat'.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      internal changes, covered by existing tests

      Description

      When an instance of class Puppet::Module is created, the initialize method will first call has_metadata? to check if the metadata.json file is present and valid. This method will do a full parse of the file to check its validity. Next, the initializer will call the method load_metadata. It parses the same file once again.

      Suggestion:

      1. Add a validity check to the load_metadata method by adding a begin/rescue around its PSON.parse
      2. Remove the call to has_metadata? from the initialize method

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            thomas.hallgren Thomas Hallgren
            QA Contact:
            John Duarte
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support