Add parameter client_timeout

This add parameter client_timeout as new parameter for class proxy.

Change-Id: Ie0fe6d3b8a3f350c181fd318ba207be14b83b08a
This commit is contained in:
Simeon Gourlin 2019-11-08 15:57:48 +01:00
parent 57503cb95a
commit 7a1851920d
No known key found for this signature in database
GPG Key ID: 7EC9FFDBDFF0A280
3 changed files with 13 additions and 0 deletions

View File

@ -86,6 +86,10 @@
# Optional but requires write_affinity to be set. # Optional but requires write_affinity to be set.
# Defaults to undef. # Defaults to undef.
# #
# [*client_timeout*]
# (optional) Configures client_timeout for swift proxy-server.
# Defaults to undef.
#
# [*node_timeout*] # [*node_timeout*]
# (optional) Configures node_timeout for swift proxy-server # (optional) Configures node_timeout for swift proxy-server
# Defaults to undef. # Defaults to undef.
@ -159,6 +163,7 @@ class swift::proxy(
$read_affinity = undef, $read_affinity = undef,
$write_affinity = undef, $write_affinity = undef,
$write_affinity_node_count = undef, $write_affinity_node_count = undef,
$client_timeout = undef,
$node_timeout = undef, $node_timeout = undef,
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,
@ -222,6 +227,7 @@ class swift::proxy(
'DEFAULT/log_address': value => $log_address; 'DEFAULT/log_address': value => $log_address;
'DEFAULT/log_udp_host': value => $log_udp_host; 'DEFAULT/log_udp_host': value => $log_udp_host;
'DEFAULT/log_udp_port': value => $log_udp_port; 'DEFAULT/log_udp_port': value => $log_udp_port;
'DEFAULT/client_timeout': value => $client_timeout;
'pipeline:main/pipeline': value => join($pipeline, ' '); 'pipeline:main/pipeline': value => join($pipeline, ' ');
'app:proxy-server/use': value => 'egg:swift#proxy'; 'app:proxy-server/use': value => 'egg:swift#proxy';
'app:proxy-server/set log_name': value => $log_name; 'app:proxy-server/set log_name': value => $log_name;

View File

@ -0,0 +1,5 @@
---
features:
- |
Added new parameter client_timeout to proxy class that can be used to
configure the timeout to read one chunk from a client.

View File

@ -111,6 +111,7 @@ describe 'swift::proxy' do
:read_affinity => 'r1z1=100, r1=200', :read_affinity => 'r1z1=100, r1=200',
:write_affinity => 'r1', :write_affinity => 'r1',
:write_affinity_node_count => '2 * replicas', :write_affinity_node_count => '2 * replicas',
:client_timeout => '120',
:node_timeout => '20', :node_timeout => '20',
:cors_allow_origin => 'http://foo.bar:1234,https://foo.bar', :cors_allow_origin => 'http://foo.bar:1234,https://foo.bar',
} }
@ -127,6 +128,7 @@ describe 'swift::proxy' do
it { should contain_swift_proxy_config('DEFAULT/log_address').with_value('/dev/log') } it { should contain_swift_proxy_config('DEFAULT/log_address').with_value('/dev/log') }
it { should contain_swift_proxy_config('DEFAULT/cors_allow_origin').with_value('http://foo.bar:1234,https://foo.bar') } it { should contain_swift_proxy_config('DEFAULT/cors_allow_origin').with_value('http://foo.bar:1234,https://foo.bar') }
it { should contain_swift_proxy_config('DEFAULT/strict_cors_mode').with_value('true') } it { should contain_swift_proxy_config('DEFAULT/strict_cors_mode').with_value('true') }
it { should contain_swift_proxy_config('DEFAULT/client_timeout').with_value('120') }
it { should contain_swift_proxy_config('pipeline:main/pipeline').with_value('swauth proxy-server') } it { should contain_swift_proxy_config('pipeline:main/pipeline').with_value('swauth proxy-server') }
it { should contain_swift_proxy_config('app:proxy-server/use').with_value('egg:swift#proxy') } it { should contain_swift_proxy_config('app:proxy-server/use').with_value('egg:swift#proxy') }
it { should contain_swift_proxy_config('app:proxy-server/set log_name').with_value('swift-proxy-server') } it { should contain_swift_proxy_config('app:proxy-server/set log_name').with_value('swift-proxy-server') }