From 1b8acf70456331625cd284eafbec50f22c4f9229 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 21 Jan 2009 10:48:15 +0000
Subject: [PATCH] Log the rpc call name in the RPC errors message

Currently the rpc module logs the error description and target node in
rpc calls logging, as such:

  2009-01-21 00:50:01,456:  pid=1051/Thread-21 ERROR RPC error from node
    node1.example.com: Connection failed (111: Connection
    refused)

but this doesn't help to understand which call caused this (here it's an
offline node which should not be contacted at all).

This patch adds the logging of the call too, so cases like the above can
be debugged easier.

Reviewed-by: imsnah, ultrotter
---
 lib/rpc.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/rpc.py b/lib/rpc.py
index fc71a9335..05613ef12 100644
--- a/lib/rpc.py
+++ b/lib/rpc.py
@@ -234,7 +234,8 @@ class Client:
       else:
         msg = req.resp_body
 
-      logging.error("RPC error from node %s: %s", name, msg)
+      logging.error("RPC error in %s from node %s: %s",
+                    self.procedure, name, msg)
       results[name] = RpcResult(data=msg, failed=True, node=name,
                                 call=self.procedure)
 
-- 
GitLab