summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-07-27 01:54:39 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-27 01:20:15 -0700
commit14f00f972b8dda94f7797ed71398c5e365883fd6 (patch)
tree9ba0e0be52b5e1b05dbfb919052317fb6ac20a35 /xlators/protocol
parenta7795fedd4ee2ed7de2dce89fd782ae20b03f6a4 (diff)
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 <shishirng@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> 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
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-handshake.c12
1 files 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;
}