Issue #21705 has been updated by Josh Cooper.
This occurs because in [Puppet::Util::Pidlock#lock_pid](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/pidlock.rb#L34), `@lockfile.lock_data` is `""`, and `"".to_i` returns 0. But then the logic that checks to see if the [pid is stale](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/pidlock.rb#L41-L53) seems confused. I don't see how `lock_pid` could ever return nil, and if it did, shouldn't we unlock the stale file? In any case, since `lock_pid` is `0`, we call `Process.kill(0, 0)` which returns 1, because ruby "helpfully" interprets pid 0 to be the [current process](http://www.ruby-doc.org/core-1.9.3/Process.html#method-c-kill). ---------------------------------------- Feature #21705: Empty pidlock files should be considered stale and cleaned up https://projects.puppetlabs.com/issues/21705#change-95067 * Author: RoMan Shipovskij * Status: Accepted * Priority: Normal * Assignee: * Category: agent * Target version: 3.x * Affected Puppet version: * Keywords: agent_catalog_run_lockfile daemon pidlock * Branch: ---------------------------------------- Sometimes, after incorrect system shutdown, catalog run lock file is empty, and agent always show message: <pre> Notice: Run of Puppet configuration client already in progress; skipping </pre> only manual removing lock file helps to reproduce: <pre> touch $(puppet agent --configprint agent_catalog_run_lockfile) </pre> now agent newer apply catalog again -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
