From c6284275751c8cc8b4e8f612724135de7d177d82 Mon Sep 17 00:00:00 2001 From: John Trowbridge Date: Mon, 25 Jul 2016 12:08:16 -0400 Subject: [PATCH] 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 --- lib/puppet/provider/openstack.rb | 4 ++-- spec/unit/provider/openstack_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puppet/provider/openstack.rb b/lib/puppet/provider/openstack.rb index bcbf77b2..0240ce4b 100644 --- a/lib/puppet/provider/openstack.rb +++ b/lib/puppet/provider/openstack.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 diff --git a/spec/unit/provider/openstack_spec.rb b/spec/unit/provider/openstack_spec.rb index 766188ed..375df177 100644 --- a/spec/unit/provider/openstack_spec.rb +++ b/spec/unit/provider/openstack_spec.rb @@ -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/