summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2017-03-05 21:39:20 +0530
committerJeff Darcy <jdarcy@redhat.com>2017-03-07 07:05:38 -0500
commit89c6bedc1c2e978f67ca29f212a357984cd8a2dd (patch)
tree7d61b9de38fc06b3c2407deae084347447f79b4f /glusterfsd/src
parentc429595b80c23d2e10051cb9f70ed53f771e8f06 (diff)
rpc: avoid logging success on failure
Avoid logging Success in the event of failure especially when errno has no meaningful value w.r.t. the failure. In this case the errno is set to zero when there's indeed a failure at the RPC level. Change-Id: If2cc81aa1e590023ed22892dacbef7cac213e591 BUG: 1426032 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: https://review.gluster.org/16730 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'glusterfsd/src')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 6871582abb0..3f06893fafa 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -2100,9 +2100,20 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
switch (event) {
case RPC_CLNT_DISCONNECT:
- GF_LOG_OCCASIONALLY (log_ctr1, "glusterfsd-mgmt", GF_LOG_ERROR,
- "failed to connect with remote-host: %s (%s)",
- ctx->cmd_args.volfile_server, strerror (errno));
+ if (rpc_trans->connect_failed) {
+ GF_LOG_OCCASIONALLY (log_ctr1, "glusterfsd-mgmt",
+ GF_LOG_ERROR,
+ "failed to connect to remote-"
+ "host: %s",
+ ctx->cmd_args.volfile_server);
+ } else {
+ GF_LOG_OCCASIONALLY (log_ctr1, "glusterfsd-mgmt",
+ GF_LOG_INFO,
+ "disconnected from remote-"
+ "host: %s",
+ ctx->cmd_args.volfile_server);
+ }
+
if (!rpc->disabled) {
/*
* Check if dnscache is exhausted for current server