You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ke...@apache.org on 2014/02/28 20:09:22 UTC
git commit: Make http signaler timeout secs configurable via
environment variable.
Repository: incubator-aurora
Updated Branches:
refs/heads/master c428f4c9b -> c2614529b
Make http signaler timeout secs configurable via environment variable.
This is a band-aid for the issue described in AURORA-224. Further
improvements would be made possible by refactoring the updater
to completely remove client-side health checking (delegating to
thermos, which already supports a much richer system of delegated
health checks).
Testing Done:
./build-support/jenkins/build.sh
Bugs closed: AURORA-224
Reviewed at https://reviews.apache.org/r/18602/
Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/c2614529
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/c2614529
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/c2614529
Branch: refs/heads/master
Commit: c2614529b23ec684fc39a5f2c0641f18c0a5f630
Parents: c428f4c
Author: Kevin Sweeney <ke...@apache.org>
Authored: Fri Feb 28 11:09:06 2014 -0800
Committer: Kevin Sweeney <ke...@apache.org>
Committed: Fri Feb 28 11:09:06 2014 -0800
----------------------------------------------------------------------
.../python/apache/aurora/common/http_signaler.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/c2614529/src/main/python/apache/aurora/common/http_signaler.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/common/http_signaler.py b/src/main/python/apache/aurora/common/http_signaler.py
index b19b72d..e63d6f8 100644
--- a/src/main/python/apache/aurora/common/http_signaler.py
+++ b/src/main/python/apache/aurora/common/http_signaler.py
@@ -15,6 +15,7 @@
#
import contextlib
+import os
from socket import timeout as SocketTimeout
import sys
@@ -39,10 +40,20 @@ class HttpSignaler(object):
class Error(Exception): pass
class QueryError(Error): pass
- def __init__(self, port, host='localhost', timeout_secs=TIMEOUT_SECS):
+ def __init__(self, port, host='localhost', timeout_secs=None):
self._host = host
self._url_base = 'http://%s:%d/' % (host, port)
- self._timeout_secs = timeout_secs
+ if timeout_secs is None:
+ env_timeout = os.getenv('AURORA_HTTP_SIGNALER_TIMEOUT_SECS')
+ if env_timeout is not None:
+ log.info('Using timeout %s secs (from AURORA_HTTP_SIGNALER_TIMEOUT_SECS).' % env_timeout)
+ self._timeout_secs = float(env_timeout)
+ else:
+ log.debug('Using timeout %s secs (default).' % self.TIMEOUT_SECS)
+ self._timeout_secs = self.TIMEOUT_SECS
+ else:
+ log.debug('Using timeout %s secs.' % timeout_secs)
+ self._timeout_secs = timeout_secs
def url(self, endpoint):
return self._url_base + endpoint