Commit 0d1e78dd authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

rpc: Remove leftovers from timeout table


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent ee14d800
......@@ -37,7 +37,11 @@ RPC definition fields:
"""
# Various time constants for the timeout table
# Guidelines for choosing timeouts:
# - call used during watcher: timeout of 1min, _TMO_URGENT
# - trivial (but be sure it is trivial) (e.g. reading a file): 5min, _TMO_FAST
# - other calls: 15 min, _TMO_NORMAL
# - special calls (instance add, etc.): either _TMO_SLOW (1h) or huge timeouts
TMO_URGENT = 60 # one minute
TMO_FAST = 5 * 60 # five minutes
TMO_NORMAL = 15 * 60 # 15 minutes
......
......@@ -71,16 +71,6 @@ _TMO_SLOW = 3600 # one hour
_TMO_4HRS = 4 * 3600
_TMO_1DAY = 86400
# Timeout table that will be built later by decorators
# Guidelines for choosing timeouts:
# - call used during watcher: timeout -> 1min, _TMO_URGENT
# - trivial (but be sure it is trivial) (e.g. reading a file): 5min, _TMO_FAST
# - other calls: 15 min, _TMO_NORMAL
# - special calls (instance add, etc.): either _TMO_SLOW (1h) or huge timeouts
_TIMEOUTS = {
}
#: Special value to describe an offline host
_OFFLINE = object()
......@@ -127,21 +117,6 @@ def _ConfigRpcCurl(curl):
curl.setopt(pycurl.CONNECTTIMEOUT, _RPC_CONNECT_TIMEOUT)
def _RpcTimeout(secs):
"""Timeout decorator.
When applied to a rpc call_* function, it updates the global timeout
table with the given function/timeout.
"""
def decorator(f):
name = f.__name__
assert name.startswith("call_")
_TIMEOUTS[name[len("call_"):]] = secs
return f
return decorator
def RunWithRPC(fn):
"""RPC-wrapper decorator.
......@@ -420,9 +395,6 @@ class _RpcProcessor:
@param read_timeout: Read timeout for request
"""
if read_timeout is None:
read_timeout = _TIMEOUTS.get(procedure, None)
assert read_timeout is not None, \
"Missing RPC read timeout for procedure '%s'" % procedure
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment