From 54a7298cdd8d40aaf79615a1f580b66f83e48419 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 14 Aug 2014 14:53:24 +0200 Subject: [PATCH] rgw: add default_idle_timeout to allow override Globally overriding the rgw idle_timeout is not possible because it it needs to be done on a per client.0, client.1, etc. basis. Add the default_idle_timeout key to the rgw config : it defaults to the previously hardcoded default (30) and can be changed via the override. The existing tasks that were previously overriding the idle_timeout on a per client basis are changed to use the default_idle_timeout instead for consistency and to allow a global override. Signed-off-by: Loic Dachary --- machine_types/vps.yaml | 9 +-------- suites/rgw/verify/tasks/rgw_s3tests_multiregion.yaml | 3 +-- .../dumpling-x/stress-split/9-workload/rgw-s3tests.yaml | 3 +-- .../firefly-x/stress-split/9-workload/rgw-s3tests.yaml | 3 +-- tasks/rgw.py | 7 ++++++- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/machine_types/vps.yaml b/machine_types/vps.yaml index 465f3c102e24a..d422a374e68df 100644 --- a/machine_types/vps.yaml +++ b/machine_types/vps.yaml @@ -4,11 +4,4 @@ overrides: global: osd heartbeat grace: 100 rgw: - client.0: - idle_timeout: 1200 - client.1: - idle_timeout: 1200 - client.2: - idle_timeout: 1200 - client.3: - idle_timeout: 1200 + default_idle_timeout: 1200 diff --git a/suites/rgw/verify/tasks/rgw_s3tests_multiregion.yaml b/suites/rgw/verify/tasks/rgw_s3tests_multiregion.yaml index e1c223c3ee6e1..6b8c53f8fabe6 100644 --- a/suites/rgw/verify/tasks/rgw_s3tests_multiregion.yaml +++ b/suites/rgw/verify/tasks/rgw_s3tests_multiregion.yaml @@ -24,6 +24,7 @@ tasks: rgw log data: False rgw log meta: False - rgw: + default_idle_timeout: 300 regions: zero: api name: api1 @@ -36,14 +37,12 @@ tasks: master zone: r1z1 zones: [r1z1] client.0: - idle_timeout: 300 valgrind: [--tool=memcheck] system user: name: client0-system-user access key: 1te6NH5mcdcq0Tc5i8i2 secret key: 1y4IOauQoL18Gp2zM7lC1vLmoawgqcYPbYGcWfXv client.1: - idle_timeout: 300 valgrind: [--tool=memcheck] system user: name: client1-system-user diff --git a/suites/upgrade/dumpling-x/stress-split/9-workload/rgw-s3tests.yaml b/suites/upgrade/dumpling-x/stress-split/9-workload/rgw-s3tests.yaml index c324c0325c1d8..697ff979e6fe0 100644 --- a/suites/upgrade/dumpling-x/stress-split/9-workload/rgw-s3tests.yaml +++ b/suites/upgrade/dumpling-x/stress-split/9-workload/rgw-s3tests.yaml @@ -1,7 +1,6 @@ tasks: - rgw: - client.0: - idle_timeout: 300 + default_idle_timeout: 300 - swift: client.0: rgw_server: client.0 diff --git a/suites/upgrade/firefly-x/stress-split/9-workload/rgw-s3tests.yaml b/suites/upgrade/firefly-x/stress-split/9-workload/rgw-s3tests.yaml index c324c0325c1d8..697ff979e6fe0 100644 --- a/suites/upgrade/firefly-x/stress-split/9-workload/rgw-s3tests.yaml +++ b/suites/upgrade/firefly-x/stress-split/9-workload/rgw-s3tests.yaml @@ -1,7 +1,6 @@ tasks: - rgw: - client.0: - idle_timeout: 300 + default_idle_timeout: 300 - swift: client.0: rgw_server: client.0 diff --git a/tasks/rgw.py b/tasks/rgw.py index 5cf72dc3065b4..3417a3e472e46 100644 --- a/tasks/rgw.py +++ b/tasks/rgw.py @@ -86,7 +86,7 @@ def ship_apache_configs(ctx, config, role_endpoints): system_type = teuthology.get_system_type(remote) if not conf: conf = {} - idle_timeout = conf.get('idle_timeout', 30) + idle_timeout = conf.get('idle_timeout', ctx.rgw.default_idle_timeout) if system_type == 'deb': mod_path = '/usr/lib/apache2/modules' print_continue = 'on' @@ -706,6 +706,7 @@ def task(ctx, config): rgw region root pool: .rgw.rroot.bar rgw zone root pool: .rgw.zroot.bar-secondary - rgw: + default_idle_timeout: 30 ec-data-pool: true regions: foo: @@ -763,6 +764,10 @@ def task(ctx, config): if 'ec-data-pool' in config: ctx.rgw.ec_data_pool = bool(config['ec-data-pool']) del config['ec-data-pool'] + ctx.rgw.default_idle_timeout = 30 + if 'idle_timeout' in config: + ctx.rgw.default_idle_timeout = int(config['idle_timeout']) + del config['idle_timeout'] ctx.rgw.cache_pools = False if 'cache-pools' in config: ctx.rgw.cache_pools = bool(config['cache-pools']) -- 2.39.5