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

Race condition in Puppet::Util::Lockfile

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 3.5.0
    • Component/s: None
    • Labels:
    • Template:
    • Story Points:
      2
    • Sprint:
      Week 2014-1-8 to 2014-1-15, Week 2014-1-15 to 2014-1-21, Week 2014-1-22 to 2014-1-29

      Description

      Puppet::Util::Lockfile does not exclude other processes from acquiring a lock between the time it checks if the lock file exists and when it writes to the lock file. This allows for a race condition, and two puppet processes started simultaneously are likely to acquire the same lock.

      This has been witnessed in the wild where I work because we may have multiple request that trigger puppet runs on certain nodes. Here's an example:

      Dec 11 05:41:46 ded-4 puppet-agent[20075]: Retrieving plugin
      Dec 11 05:41:46 ded-4 puppet-agent[20076]: Retrieving plugin
      Dec 11 05:41:46 ded-4 puppet-agent[20076]: Loading facts in /var/lib/puppet/lib/facter/installed_gems.rb
      Dec 11 05:41:46 ded-4 puppet-agent[20075]: Loading facts in /var/lib/puppet/lib/facter/installed_gems.rb
      Dec 11 05:41:46 ded-4 puppet-agent[20076]: Loading facts in /var/lib/puppet/facts/ah_custom_facts.rb
      Dec 11 05:41:46 ded-4 puppet-agent[20075]: Loading facts in /var/lib/puppet/facts/ah_custom_facts.rb
      Dec 11 05:42:01 ded-4 puppet-agent[20075]: Caching catalog for ded-4.jk-ah-trunk-lucid-458-1.hosting.acquia.com
      Dec 11 05:42:02 ded-4 puppet-agent[20076]: Caching catalog for ded-4.jk-ah-trunk-lucid-458-1.hosting.acquia.com
      Dec 11 05:42:06 ded-4 puppet-agent[20075]: Applying configuration version '1386735465'
      Dec 11 05:42:07 ded-4 puppet-agent[20076]: Applying configuration version '1386739763'
      

      Note that these two puppet runs are applying different configurations - this left the node in an undefined state.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              glennpratt Glenn Pratt
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support