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

Puppet agent's locking is subject to race conditions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      3

      Description

      The agent attempts to acquire its pidlock fairly late in the agent lifecycle.

      If two agents start simultaneously, they will race until one of them acquires the lock. In between that time we perform a number of critical operations, e.g. generate SSL keys, checking if another instance is running?, etc.

      The scope of the lock should be increased. And I think the attempt to acquire the lock should raise an exception on failure, with a type of exception that indicates why it failed (due to another instance running, being administratively disabled, or some other reason). Otherwise, if the lock method returns true/false, the caller has to check why it failed, and that will introduce another race.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support