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

Memory leak in Puppet Server from loading translations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.3.6
    • Fix Version/s: PUP 5.5.3
    • Component/s: None
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Team:
      Froyo
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Addresses a small memory leak with temporary environments. When the environment cache was cleared, associated translation domains were not instead hanging onto them until they're replaced the next time the environment was used. Environments that were never used again would hang onto a small amount of memory (probably less than 100 bytes, plus whatever's used by actual translations). This has been resolved so translation domains will now be released when the related cached environment is purged.
      Show
      Addresses a small memory leak with temporary environments. When the environment cache was cleared, associated translation domains were not instead hanging onto them until they're replaced the next time the environment was used. Environments that were never used again would hang onto a small amount of memory (probably less than 100 bytes, plus whatever's used by actual translations). This has been resolved so translation domains will now be released when the related cached environment is purged.
    • QA Risk Assessment:
      Needs Assessment

      Description

      There is a memory leak introduced with i18n which is triggered when an environment is expired. If the environment was ephemeral and will never be used again, then the translation repository related to that environment will never be deleted.

      Specifically https://github.com/puppetlabs/puppet/blob/master/lib/puppet/gettext/config.rb#L120 never successfully clears a translation repository. When we add a text domain, we always use a symbolized version of the environment name. When we delete the domain, it uses the environment name in the environment cache (which is almost always a string). Meaning we almost never actually delete a domain. When an environment is used again, it will overwrite the previous translation_repositories entry, so garbage collection will then cleanup the old translation repository.

      While digging into this, we also found that successfully deleting domains leads to a thread-local storage issue in Puppet Server that will need to be addressed:

      • thread A creates an environment as part of a request
      • thread B deletes it because it's expired (so A's text_domain now refers to an absent domain) and creates a different environment
      • thread A tries to handle a request and fails because it's configured for an unknown domain.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              michael.smith Michael Smith
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support