Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
-
Needs Assessment
-
Needs Assessment
Description
Issue encountered upgrading puppet-agent at a customer site on RHEL 6, RHEL-7.
During a package upgade, the following sequence of events occurs.
- yum install runs to install the package and obtains a yum lock
- yum copies files and runs package scripts
- during the post-install package script for puppet-agent, puppet apply is invoked: /opt/puppetlabs/bin/puppet apply /var/lib/rpm-state/puppet/service.pp
There's a little bit of a problem here customers can run into involving yum, and facts.
A customer I work with has a fact that invokes yum versionlock list. When puppet apply is run, it will invoke this fact. This yum commands requires the yum lock.
During an upgrade, this can create a deadlock situation. Yum runs and holds the lock to perform an install. The install post-install script invokes Puppet, which invokes Facter, which invokes a yum command that requires the yum lock and so blocks until it can get it. Because yum is in the middle of installing the package the lock is not available, and it won't be released until the post-install script completes. Deadlock.
Solution
We should avoid invoking Puppet during package install scripts for trivial actions like enabling the service, or else we should ensure that unknown customer code is not loaded when we do so.
Attachments
Issue Links
- duplicates
-
PA-1402 Puppet-agent install deadlocks if you have a custom fact that calls out to yum
-
- Closed
-