summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/common.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-22 16:47:58 +0000
committerGerrit Code Review <review@openstack.org>2013-03-22 16:47:58 +0000
commitf48e798f0e10a657a52896b2237243c4b93e7f3c (patch)
tree78a0c447372c928a550e0b51a935c4f7f61ef4f1 /openstack/common/rpc/common.py
parenteb2f2c757e01544ab6e67ffcc0a9dc741e69860f (diff)
parent229b815fb72dccf998b18a0ad019cc61ccb888d8 (diff)
downloadoslo-f48e798f0e10a657a52896b2237243c4b93e7f3c.tar.gz
oslo-f48e798f0e10a657a52896b2237243c4b93e7f3c.tar.xz
oslo-f48e798f0e10a657a52896b2237243c4b93e7f3c.zip
Merge "Improves Logging for for rpc method timeouts"
Diffstat (limited to 'openstack/common/rpc/common.py')
-rw-r--r--openstack/common/rpc/common.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py
index 8bffc2b..42aaf09 100644
--- a/openstack/common/rpc/common.py
+++ b/openstack/common/rpc/common.py
@@ -118,7 +118,25 @@ class Timeout(RPCException):
This exception is raised if the rpc_response_timeout is reached while
waiting for a response from the remote side.
"""
- message = _("Timeout while waiting on RPC response.")
+ message = _('Timeout while waiting on RPC response - '
+ 'topic: "%(topic)s", RPC method: "%(method)s" '
+ 'info: "%(info)s"')
+
+ def __init__(self, info=None, topic=None, method=None):
+ """
+ :param info: Extra info to convey to the user
+ :param topic: The topic that the rpc call was sent to
+ :param rpc_method_name: The name of the rpc method being
+ called
+ """
+ self.info = info
+ self.topic = topic
+ self.method = method
+ super(Timeout, self).__init__(
+ None,
+ info=info or _('<unknown>'),
+ topic=topic or _('<unknown>'),
+ method=method or _('<unknown>'))
class DuplicateMessageError(RPCException):