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

    • Template:
    • Team:
      Platform OS
    • Story Points:
      2
    • Sprint:
      Platform OS Kanban
    • CS Priority:
      Major
    • CS Frequency:
      2 - 5-25% of Customers
    • CS Severity:
      4 - Major
    • CS Business Value:
      3 - $$$$
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support