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

Default timeout not respected for Windows services

    XMLWordPrintable

Details

    • Night's Watch
    • 1
    • NW - 2021-09-22
    • Needs Assessment
    • Bug Fix
    • Hide
      This fix allows provider to be asked for default timeout value for syncing service properties when it has one instead of always defaulting to 10. This was causing issues on Windows when services were taking more than 10 seconds to change state or sync properties instead of waiting for 30 seconds as the provider was set to.
      Show
      This fix allows provider to be asked for default timeout value for syncing service properties when it has one instead of always defaulting to 10. This was causing issues on Windows when services were taking more than 10 seconds to change state or sync properties instead of waiting for 30 seconds as the provider was set to.
    • Needs Assessment

    Description

      Puppet Version: 6.21.1
      Puppet Server Version: n/a
      OS Name/Version: Windows

      Windows services have a timeout for service-related operations that defaults to 30 seconds, as seen here: https://github.com/puppetlabs/puppet/blob/e4a654400a4c1ad3b5bc73fb558d28219a4626b2/lib/puppet/util/windows/service.rb#L24

      This variable is used in the following method: https://github.com/puppetlabs/puppet/blob/c6412ea369aa1613ca166b10fb819fcf6130814b/lib/puppet/provider/service/windows.rb#L118

      The method is called in the base service type: https://github.com/puppetlabs/puppet/blob/e4a654400a4c1ad3b5bc73fb558d28219a4626b2/lib/puppet/type/service.rb#L301

      Desired Behavior:

      Not setting the timeout parameter on a Windows service should cause it to default to 30 seconds.

      Actual Behavior:

      Not setting the timeout parameter on a Windows services causes it to default to 10 seconds.

       

      The line in the service type should change from:

      defaultto { provider.class.respond_to?(:default_timeout) ? provider.default_timeout : 10 }
      

      to

      defaultto { provider.respond_to?(:default_timeout) ? provider.default_timeout : 10 }
      

      Attachments

        Issue Links

          Activity

            People

              luchian.nemes Luchian Nemes
              gabriel.nagy Gabriel Nagy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support