Increase command_timeout for openstackclient commands

We recently patched the openstackclient code to increase the number
of retries when running commands[1], but I think what we really wanted
was to increase the amount of time to wait on each retry.

The original approach did help somewhat, but it is doing so by just
racing more times. Instead, it would be better to win the race more
often.

This is mostly a CI or developer environment issue where we are
deploying with the minimal amount of computing resources to get
a functioning cloud.

[1] https://git.openstack.org/cgit/openstack/puppet-openstacklib/commit/?id=489099632446b1903986549e5feb80b509f9b77d

Change-Id: I0707165a9e8054c1b3e0ad299604356cecc9f99f
changes/15/346915/2
John Trowbridge 6 years ago
parent f37a0a339a
commit c628427575
  1. 4
      lib/puppet/provider/openstack.rb
  2. 2
      spec/unit/provider/openstack_spec.rb

@ -14,8 +14,8 @@ class Puppet::Provider::Openstack < Puppet::Provider
commands :openstack_command => 'openstack'
@@no_retry_actions = %w(create remove delete)
@@command_timeout = 20
# Fails on the 8th retry for a max of 181s (~3min) before total
@@command_timeout = 40
# Fails on the 5th retry for a max of 212s (~3.5min) before total
# failure.
@@request_timeout = 170
@@retry_sleep = 3

@ -103,7 +103,7 @@ name="test"
.times(3)
provider.class.stubs(:sleep)
provider.class.stubs(:current_time)
.returns(0, 10, 10, 20, 20, 180, 180)
.returns(0, 10, 10, 20, 20, 200, 200)
expect do
Puppet::Provider::Openstack.request('project', 'list', ['--long'])
end.to raise_error Puppet::ExecutionFailure, /Unable to establish connection/

Loading…
Cancel
Save