summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-handshake.c2
-rw-r--r--xlators/protocol/client/src/client.c5
-rw-r--r--xlators/protocol/client/src/client.h5
3 files changed, 11 insertions, 1 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 5c4816ee20a..c08faccc75d 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -1701,6 +1701,7 @@ client_query_portmap_cbk (struct rpc_req *req, struct iovec *iov, int count, voi
config.remote_port = rsp.port;
rpc_clnt_reconfig (conf->rpc, &config);
conf->skip_notify = 1;
+ conf->quick_reconnect = 1;
out:
if (frame)
@@ -1710,7 +1711,6 @@ out:
/* Need this to connect the same transport on different port */
/* ie, glusterd to glusterfsd */
rpc_transport_disconnect (conf->rpc->conn.trans);
- rpc_clnt_reconnect (conf->rpc->conn.trans);
}
return ret;
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 16c7dee5ece..6cc3c9896ae 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2110,6 +2110,11 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
conf->connected = 0;
conf->skip_notify = 0;
+ if (conf->quick_reconnect) {
+ conf->quick_reconnect = 0;
+ rpc_clnt_start (conf->rpc);
+ }
+
break;
default:
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index 9d8a818aa9f..420674910a8 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -109,6 +109,11 @@ typedef struct clnt_conf {
means dont register, true
means register */
char parent_down;
+ gf_boolean_t quick_reconnect; /* When reconnecting after
+ portmap query, do not let
+ the reconnection happen after
+ the usual 3-second wait
+ */
} clnt_conf_t;
typedef struct _client_fd_ctx {