From bd70af729641502677dfe1d19cf6a73c066b3722 Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Tue, 3 Jun 2014 20:38:25 -0500 Subject: [PATCH] Add config options for proxy-server.conf template. node-timeout and recoverable-node-timeout. For large swift/glance uploads, higher defaults are needed to prevent uploads from failing on real servers which are slower than VMs. --- config.yaml | 13 +++++++++++++ hooks/swift_context.py | 4 +++- revision | 2 +- templates/essex/proxy-server.conf | 2 ++ templates/grizzly/proxy-server.conf | 2 ++ templates/havana/proxy-server.conf | 2 ++ templates/icehouse/proxy-server.conf | 2 ++ unit_tests/test_templates.py | 4 ++-- 8 files changed, 27 insertions(+), 4 deletions(-) diff --git a/config.yaml b/config.yaml index 11b73ff..77de0ec 100644 --- a/config.yaml +++ b/config.yaml @@ -106,6 +106,19 @@ options: default: true type: boolean description: Delay authentication to downstream WSGI services. + node-timeout: + default: 60 + type: int + description: How long the proxy server will wait on responses from the a/c/o servers. + recoverable-node-timeout: + default: 30 + type: int + description: | + How long the proxy server will wait for an initial response and to read a + chunk of data from the object servers while serving GET / HEAD requests. + Timeouts from these requests can be recovered from so setting this to + something lower than node-timeout would provide quicker error recovery + while allowing for a longer timeout for non-recoverable requests (PUTs). # Manual Keystone configuration. keystone-auth-host: type: string diff --git a/hooks/swift_context.py b/hooks/swift_context.py index 49fb4c1..2ff68ae 100644 --- a/hooks/swift_context.py +++ b/hooks/swift_context.py @@ -139,7 +139,9 @@ class SwiftIdentityContext(OSContextGenerator): 'bind_port': determine_api_port(bind_port), 'workers': workers, 'operator_roles': config('operator-roles'), - 'delay_auth_decision': config('delay-auth-decision') + 'delay_auth_decision': config('delay-auth-decision'), + 'node_timeout': config('node-timeout'), + 'recoverable_node_timeout': config('recoverable-node-timeout'), } ctxt['ssl'] = False diff --git a/revision b/revision index 878d5a0..c748b56 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -146 +147 diff --git a/templates/essex/proxy-server.conf b/templates/essex/proxy-server.conf index 0898ee0..bb3f311 100644 --- a/templates/essex/proxy-server.conf +++ b/templates/essex/proxy-server.conf @@ -19,6 +19,8 @@ pipeline = healthcheck cache tempauth proxy-server use = egg:swift#proxy allow_account_management = true {% if auth_type == 'keystone' %}account_autocreate = true{% endif %} +node_timeout = {{ node_timeout }} +recoverable_node_timeout = {{ recoverable_node_timeout }} [filter:tempauth] use = egg:swift#tempauth diff --git a/templates/grizzly/proxy-server.conf b/templates/grizzly/proxy-server.conf index 0539167..a46934c 100644 --- a/templates/grizzly/proxy-server.conf +++ b/templates/grizzly/proxy-server.conf @@ -19,6 +19,8 @@ pipeline = healthcheck cache tempauth container-quotas account-quotas proxy-serv use = egg:swift#proxy allow_account_management = true {% if auth_type == 'keystone' %}account_autocreate = true{% endif %} +node_timeout = {{ node_timeout }} +recoverable_node_timeout = {{ recoverable_node_timeout }} [filter:tempauth] use = egg:swift#tempauth diff --git a/templates/havana/proxy-server.conf b/templates/havana/proxy-server.conf index 3c7c99e..87a2256 100644 --- a/templates/havana/proxy-server.conf +++ b/templates/havana/proxy-server.conf @@ -19,6 +19,8 @@ pipeline = healthcheck cache tempauth container-quotas account-quotas proxy-serv use = egg:swift#proxy allow_account_management = true {% if auth_type == 'keystone' %}account_autocreate = true{% endif %} +node_timeout = {{ node_timeout }} +recoverable_node_timeout = {{ recoverable_node_timeout }} [filter:tempauth] use = egg:swift#tempauth diff --git a/templates/icehouse/proxy-server.conf b/templates/icehouse/proxy-server.conf index 4ad112a..ae85e3e 100644 --- a/templates/icehouse/proxy-server.conf +++ b/templates/icehouse/proxy-server.conf @@ -19,6 +19,8 @@ pipeline = gatekeeper healthcheck cache container_sync bulk tempurl slo dlo form use = egg:swift#proxy allow_account_management = true {% if auth_type == 'keystone' %}account_autocreate = true{% endif %} +node_timeout = {{ node_timeout }} +recoverable_node_timeout = {{ recoverable_node_timeout }} [filter:tempauth] use = egg:swift#tempauth diff --git a/unit_tests/test_templates.py b/unit_tests/test_templates.py index 0740ad3..91b91ea 100644 --- a/unit_tests/test_templates.py +++ b/unit_tests/test_templates.py @@ -46,7 +46,7 @@ class ProxyServerTemplateTestCase(unittest.TestCase): The os_release is no longer provided as context to the templates. """ - for release in ('essex', 'grizzly', 'havana'): + for release in ('essex', 'grizzly', 'havana', 'icehouse'): template = self.get_template_for_release(release) with open(template.filename, 'r') as template_orig: self.assertNotIn( @@ -57,7 +57,7 @@ class ProxyServerTemplateTestCase(unittest.TestCase): def test_config_renders_for_all_releases(self): """The configs render without syntax error.""" - for release in ('essex', 'grizzly', 'havana'): + for release in ('essex', 'grizzly', 'havana', 'icehouse'): template = self.get_template_for_release(release) result = template.render()