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

Reduce FastGettext's reads of empty.mo

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.3.4, PUP 5.4.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      FastGettext no longer tries to read empty.mo repeatedly during a request

      Show
      FastGettext no longer tries to read empty.mo repeatedly during a request
    • Team:
      Platform Core
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      No Action

      Description

      While processing a request, the puppet master outputs dozens of lines like this one:

      [pid  3536] open("/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/vendor/empty.mo", O_RDONLY|O_CLOEXEC) = 13
      

      This is most likely coming from modules that have a locales directory but no translations for the selected locale. FastGettext will create a dummy empty translation file for it to load and read. We should see if there is a way we can avoid most of these reads.

      One idea is to not create translation repositories (which load translation – or empty.mo – files lazily) for modules that don't have translations for the selected locale. We don't currently support changing the locale at runtime, so checking for the relevant locale directory before creating the repository might be sufficient.

        Attachments

          Activity

            People

            • Assignee:
              maggie Maggie Dreyer
              Reporter:
              maggie Maggie Dreyer
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support