From 9f480be0333863a2cb30088504d233fd6eb46ebf Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Thu, 9 Dec 2010 02:06:52 +0000 Subject: protocol: avoid repetitive disconnect logs Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875 --- xlators/protocol/client/src/client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/protocol/client/src/client.c') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index e83badca98a..56ac45a4d27 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1559,6 +1559,7 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, switch (event) { case RPC_CLNT_CONNECT: { + conf->connected = 1; // connect happened, send 'get_supported_versions' mop ret = dict_get_str (this->options, "disable-handshake", &handshake); @@ -1584,12 +1585,17 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, client_mark_fd_bad (this); if (!conf->skip_notify) { - gf_log (this->name, GF_LOG_NORMAL, "disconnected"); + if (conf->connected) + gf_log (this->name, GF_LOG_NORMAL, + "disconnected"); default_notify (this, GF_EVENT_CHILD_DOWN, NULL); } else { - gf_log (this->name, GF_LOG_TRACE, "disconnected (skipped notify)"); + if (conf->connected) + gf_log (this->name, GF_LOG_DEBUG, + "disconnected (skipped notify)"); } + conf->connected = 0; conf->skip_notify = 0; break; -- cgit