From 14f00f972b8dda94f7797ed71398c5e365883fd6 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Tue, 27 Jul 2010 01:54:39 +0000 Subject: Cancel ping timer if socket or ib error If the there is an socket or ib error, fail the ping request to prevent retries. Which would cause active connections to be disconnected Signed-off-by: shishir gowda Signed-off-by: Anand V. Avati BUG: 907 (cancel ping timer in case of socket fd error or iberror) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=907 --- xlators/protocol/client/src/client-handshake.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 69035d458..1cd25424f 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -219,8 +219,16 @@ client_ping_cbk (struct rpc_req *req, struct iovec *iov, int count, conn = &conf->rpc->conn; if (req->rpc_status == -1) { - /* timer expired and transport bailed out */ - gf_log (this->name, GF_LOG_DEBUG, "timer must have expired"); + if (conn->ping_timer != NULL) { + gf_log (this->name, GF_LOG_DEBUG, "socket or ib" + " related error"); + gf_timer_call_cancel (this->ctx, conn->ping_timer); + conn->ping_timer = NULL; + } else { + /* timer expired and transport bailed out */ + gf_log (this->name, GF_LOG_DEBUG, "timer must have " + "expired"); + } goto out; } -- cgit