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

Large volumes of RPM queries leave stale locks on the rpm database

    Details

    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDS 2016-11-30, PDE 2016-12-14
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Previously, Puppet did not appropriately quote the RPM query string when determining package state with the RPM provider. This caused stale locks to be left on the RPM database when large volumes of RPM queries were run. This change adds the necessary quotes to the query to prevent this from happening.
      Show
      Previously, Puppet did not appropriately quote the RPM query string when determining package state with the RPM provider. This caused stale locks to be left on the RPM database when large volumes of RPM queries were run. This change adds the necessary quotes to the query to prevent this from happening.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      low risk, covered decently by unit tests

      Description

      When running large volumes of rpm queries as the root user to determine package state, locks are placed on the rpm database that can become stale and prevent package installation/removal through either the rpm or yum providers.

      Working directly with Red Hat, it was determined that this isn't an issue when executed as non-root users since no attempt is made to access the /var/lib/rpm/__db.[nnn] files. Obviously this isn't the normal scenario as typically puppet is run as root.

      Example:

      // Non-root user strace of an "rpm -qa"

      1. grep db.00 /tmp/rpm.non-root.strace
        #

      // root user strace of an "rpm -qa"

      1. grep db.00 /tmp/rpm.root.strace
        access("/var/lib/rpm/__db.001", F_OK) = 0
        open("/var/lib/rpm/__db.001", O_RDWR) = 3
        open("/var/lib/rpm/__db.001", O_RDWR) = 3
        open("/var/lib/rpm/__db.002", O_RDWR) = 3
        open("/var/lib/rpm/__db.003", O_RDWR) = 3
        open("/var/lib/rpm/__db.004", O_RDWR) = 3
        access("/var/lib/rpm/__db.001", F_OK) = 0

      The fix to prevent stale locks from occurring in situations of large query volumes appears to be properly quoting the query format string (represented as NEVRA_FORMAT) in the rpm provider.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                exodusftw Jeremy Grant [X] (Inactive)
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support