From fa2b39dd65eb1bb9a25ea0a52f9601eddef4c9eb Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 7 May 2020 16:13:07 +0200 Subject: [PATCH] Add client_timeout parameter for object-server.conf Sometimes, the default of 60s is just not enough, so we make this configurable for the object-server.conf. Change-Id: I965d5178f1f367e8b7b1f6137ff5290a75ffb030 --- manifests/storage/server.pp | 6 ++++++ releasenotes/notes/client-timeout-c110deab64aa1944.yaml | 6 ++++++ spec/defines/swift_storage_server_spec.rb | 8 ++++++++ templates/object-server.conf.erb | 1 + 4 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/client-timeout-c110deab64aa1944.yaml diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 4b91449c..8bf0fd7e 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -159,6 +159,11 @@ # (optional) Object-auditor size of chunks to read/write to disk. # Defaults to undef. # +# [*client_timeout*] +# (optional) Object-server timeout in seconds to read one chunk from a client +# external services. +# Defaults to 60. +# # [*splice*] # (optional) Use splice for zero-copy object GETs. This requires Linux Kernel # version 3.0 or greater. @@ -204,6 +209,7 @@ define swift::storage::server( $log_statsd_metric_prefix = '', $network_chunk_size = 65536, $disk_chunk_size = 65536, + $client_timeout = 60, $auditor_disk_chunk_size = undef, $splice = false, $object_server_mb_per_sync = 512, diff --git a/releasenotes/notes/client-timeout-c110deab64aa1944.yaml b/releasenotes/notes/client-timeout-c110deab64aa1944.yaml new file mode 100644 index 00000000..52f4f0fe --- /dev/null +++ b/releasenotes/notes/client-timeout-c110deab64aa1944.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + A new parameter client_timeout has been added to the storage::server class + (useful only if type=object). It is similar to the client_timeout parameter + used in the proxy class, except that it is for object. diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index 81209fcf..8103232c 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -129,6 +129,14 @@ describe 'swift::storage::server' do let :params do req_params.merge({ :splice => true, }) end it { is_expected.to contain_concat_fragment("swift-#{t}-#{title}").with_content(/^splice\s*=\s*true\s*$/) } end + + describe "when client_timeout is not set" do + it { is_expected.to contain_concat_fragment("swift-#{t}-#{title}").with_content(/^client_timeout\s*=\s*60\s*$/) } + end + describe "when client_timeout is set" do + let :params do req_params.merge({ :client_timeout => 30, }) end + it { is_expected.to contain_concat_fragment("swift-#{t}-#{title}").with_content(/^client_timeout\s*=\s*30\s*$/) } + end end describe "when log_udp_port is set" do diff --git a/templates/object-server.conf.erb b/templates/object-server.conf.erb index 3b819d0a..4229306a 100644 --- a/templates/object-server.conf.erb +++ b/templates/object-server.conf.erb @@ -26,6 +26,7 @@ log_statsd_metric_prefix = <%=@log_statsd_metric_prefix%> <% end -%> network_chunk_size = <%= @network_chunk_size%> disk_chunk_size = <%= @disk_chunk_size%> +client_timeout = <%= @client_timeout %> [pipeline:main] pipeline = <%= @pipeline.to_a.join(' ') %>