summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2014-08-25 16:21:08 +0530
committerRaghavendra G <rgowdapp@redhat.com>2014-12-10 22:35:03 -0800
commit757394c1d764955f0068dfaf10692ae2d56a2b94 (patch)
tree05a5ba432a0d2f8e12a3570ebf91f0979bb23b65 /rpc/rpc-lib
parent0b293a95839a68005dd464526598a113b37b089b (diff)
rpc/rpcsvc: add peername to log messages
This would allow users/developers to associate rpc layer log messages to the corresponding connection. Change-Id: I040f79248dced7174a4364d9f995612ed3540dd4 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/8535 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index a8a09048a44..2c8eb777db1 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -222,11 +222,13 @@ rpcsvc_program_actor (rpcsvc_request_t *req)
rpcsvc_actor_t *actor = NULL;
rpcsvc_t *svc = NULL;
char found = 0;
+ char *peername = NULL;
if (!req)
goto err;
svc = req->svc;
+ peername = req->trans->peerinfo.identifier;
pthread_mutex_lock (&svc->rpclock);
{
list_for_each_entry (program, &svc->programs, program) {
@@ -250,30 +252,34 @@ rpcsvc_program_actor (rpcsvc_request_t *req)
*/
gf_log (GF_RPCSVC, (req->prognum == ACL_PROGRAM) ?
GF_LOG_DEBUG : GF_LOG_WARNING,
- "RPC program not available (req %u %u)",
- req->prognum, req->progver);
+ "RPC program not available (req %u %u) for %s",
+ req->prognum, req->progver,
+ peername);
err = PROG_UNAVAIL;
goto err;
}
gf_log (GF_RPCSVC, GF_LOG_WARNING,
- "RPC program version not available (req %u %u)",
- req->prognum, req->progver);
+ "RPC program version not available (req %u %u) for %s",
+ req->prognum, req->progver,
+ peername);
goto err;
}
req->prog = program;
if (!program->actors) {
gf_log (GF_RPCSVC, GF_LOG_WARNING,
- "RPC Actor not found for program %s %d",
- program->progname, program->prognum);
+ "RPC Actor not found for program %s %d for %s",
+ program->progname, program->prognum,
+ peername);
err = SYSTEM_ERR;
goto err;
}
if ((req->procnum < 0) || (req->procnum >= program->numactors)) {
gf_log (GF_RPCSVC, GF_LOG_ERROR, "RPC Program procedure not"
- " available for procedure %d in %s", req->procnum,
- program->progname);
+ " available for procedure %d in %s for %s",
+ req->procnum, program->progname,
+ peername);
err = PROC_UNAVAIL;
goto err;
}
@@ -281,8 +287,9 @@ rpcsvc_program_actor (rpcsvc_request_t *req)
actor = &program->actors[req->procnum];
if (!actor->actor) {
gf_log (GF_RPCSVC, GF_LOG_ERROR, "RPC Program procedure not"
- " available for procedure %d in %s", req->procnum,
- program->progname);
+ " available for procedure %d in %s for %s",
+ req->procnum, program->progname,
+ peername);
err = PROC_UNAVAIL;
actor = NULL;
goto err;
@@ -291,8 +298,9 @@ rpcsvc_program_actor (rpcsvc_request_t *req)
req->synctask = program->synctask;
err = SUCCESS;
- gf_log (GF_RPCSVC, GF_LOG_TRACE, "Actor found: %s - %s",
- program->progname, actor->procname);
+ gf_log (GF_RPCSVC, GF_LOG_TRACE, "Actor found: %s - %s for %s",
+ program->progname, actor->procname,
+ peername);
err:
if (req)
req->rpc_err = err;