From 4d9315ec54eeb5878088cccf37ef12e8dc56ede5 Mon Sep 17 00:00:00 2001 From: Christian Schwede Date: Fri, 11 Sep 2020 15:17:58 +0200 Subject: [PATCH] Add proxy config option to set recoverable_node_timeout This setting defaults to node_timeout if unset, which affects HEAD, GET and PUT requests. However, it makes sense to keep the timeout for GET and HEAD requests shorter to allow quicker recovery and prevent client timeouts. Change-Id: I2f56bc456427d5deb30d86ad70e890d0897ef0c9 --- manifests/proxy.pp | 6 ++++++ ...-recoverable-node-timeout-setting-f2520a2f6ff79433.yaml | 7 +++++++ spec/classes/swift_proxy_spec.rb | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 releasenotes/notes/proxy-recoverable-node-timeout-setting-f2520a2f6ff79433.yaml diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 5cecabf9..f776d5af 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -102,6 +102,10 @@ # (optional) Configures node_timeout for swift proxy-server # Defaults to undef. # +# [*recoverable_node_timeout*] +# (optional) Configures recoverable_node_timeout for swift proxy-server +# Defaults to undef. +# # [*enabled*] # (optional) Should the service be enabled. # Defaults to true @@ -175,6 +179,7 @@ class swift::proxy( $write_affinity_node_count = undef, $client_timeout = undef, $node_timeout = undef, + $recoverable_node_timeout = undef, $manage_service = true, $enabled = true, $package_ensure = 'present', @@ -260,6 +265,7 @@ and swift::proxy::s3api instead') 'app:proxy-server/write_affinity': value => $write_affinity; 'app:proxy-server/write_affinity_node_count': value => $write_affinity_node_count; 'app:proxy-server/node_timeout': value => $node_timeout; + 'app:proxy-server/recoverable_node_timeout': value => $recoverable_node_timeout; } if $cors_allow_origin { diff --git a/releasenotes/notes/proxy-recoverable-node-timeout-setting-f2520a2f6ff79433.yaml b/releasenotes/notes/proxy-recoverable-node-timeout-setting-f2520a2f6ff79433.yaml new file mode 100644 index 00000000..5973ea5c --- /dev/null +++ b/releasenotes/notes/proxy-recoverable-node-timeout-setting-f2520a2f6ff79433.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Adds a new proxy config option to set recoverable_node_timeout. This + setting defaults to node_timeout, which affects HEAD, GET and PUT requests. + However, it makes sense to keep the timeout for GET and HEAD requests + shorter to allow quicker recovery and prevent client timeouts. diff --git a/spec/classes/swift_proxy_spec.rb b/spec/classes/swift_proxy_spec.rb index e5bdca5b..f868c77b 100644 --- a/spec/classes/swift_proxy_spec.rb +++ b/spec/classes/swift_proxy_spec.rb @@ -117,6 +117,7 @@ describe 'swift::proxy' do :write_affinity_node_count => '2 * replicas', :client_timeout => '120', :node_timeout => '20', + :recoverable_node_timeout => '15', :cors_allow_origin => 'http://foo.bar:1234,https://foo.bar', } end @@ -151,6 +152,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('app:proxy-server/write_affinity').with_value('r1') } it { should contain_swift_proxy_config('app:proxy-server/write_affinity_node_count').with_value('2 * replicas') } it { should contain_swift_proxy_config('app:proxy-server/node_timeout').with_value('20') } + it { should contain_swift_proxy_config('app:proxy-server/recoverable_node_timeout').with_value('15') } end describe "when log udp port is set" do @@ -170,6 +172,7 @@ describe 'swift::proxy' do :write_affinity => 'r1', :write_affinity_node_count => '2 * replicas', :node_timeout => '20', + :recoverable_node_timeout => '15', :cors_allow_origin => 'http://foo.bar:1234,https://foo.bar', } end @@ -194,6 +197,7 @@ describe 'swift::proxy' do :write_affinity => 'r1', :write_affinity_node_count => '2 * replicas', :node_timeout => '20', + :recoverable_node_timeout => '15', :cors_allow_origin => 'http://foo.bar:1234,https://foo.bar', } end @@ -231,6 +235,7 @@ describe 'swift::proxy' do it { should contain_swift_proxy_config('app:proxy-server/write_affinity').with_value('r1') } it { should contain_swift_proxy_config('app:proxy-server/write_affinity_node_count').with_value('2 * replicas') } it { should contain_swift_proxy_config('app:proxy-server/node_timeout').with_value('20') } + it { should contain_swift_proxy_config('app:proxy-server/recoverable_node_timeout').with_value('15') } end end