Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-1402

Puppet-agent install deadlocks if you have a custom fact that calls out to yum

    XMLWordPrintable

Details

    • Platform OS
    • 2
    • Platform OS Kanban
    • Major
    • 2 - 5-25% of Customers
    • 4 - Major
    • 3 - $$$$
    • Bug Fix
    • The puppet-agent package no longer invokes custom facts on upgrade, avoiding a deadlock when such a fact tried to access the package manager's database

    Description

      The Problem

      If you have a custom fact that calls out to yum and puppet-agent is being installed via yum then the custom fact waits for the puppet-agent install to complete and the puppet-agent install waits for facter to return and... it hangs.

      Suggested solution

      We shouldn't call puppet apply during install or if we do we should make it not load custom facts ( if that's possible ).

      My proposed solution would be that we simply record the state of the puppet service before installing instead of the whole puppet resource and then call puppet resource service puppet ensure=<state> instead of puppet apply.

      [root@master201647-centos ~]# puppet resource service puppet | grep ensure| sed 's/ensure => //' | sed s'/.$//' | sed 's/^..//' | sed "s/'//g" > puppet_service_state.txt
      [root@master201647-centos ~]# cat puppet_service_state.txt
      stopped
      [root@master201647-centos ~]# puppet resource service puppet ensure=$(cat puppet_service_state.txt)
      service { 'puppet':
        ensure => 'stopped',
      }
      

      This relates to this portion of code:

      https://github.com/puppetlabs/puppet-agent/blob/4626d6a16ac851c04a981d1b4869471fa4c23a8c/configs/components/puppet.rb#L72

      Pull Request

      https://github.com/puppetlabs/puppet-agent/pull/1283

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nick.walker Nick Walker
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support