path: root/xlators/protocol/client/src/client-handshake.c
diff options
authorRaghavendra G <>2012-10-08 14:16:21 +0530
committerAnand Avati <>2012-10-11 16:35:52 -0700
commit92754cd1d12cdda18b27911f3e50eabd907edce6 (patch)
tree5b354de1f73658d2fd6e3d865fb0081dc372784a /xlators/protocol/client/src/client-handshake.c
parent85866c6a9ef9b7401bb05f93fa9602f844d5a35b (diff)
client-handshake: synchronize config.remote_port setting b/w
rpc_clnt_reconnect and client_query_portmap_cbk problem: ------- Theoretically there is a possibility that we could complete querying the remote brick's port number before rpc_transport_connect can return. If rpc_clnt_reconnect happens to be the caller of rpc_transport_connect and we've already got the remote brick's port number by the time rpc_transport_connect returns, without synchronization, rpc_clnt_connect resets config.remote_port to zero even before we have attempted a connection with remote brick. fix: --- By making only poll thread do setting and resetting of config.remote_port, we avoid the race-condition. Change-Id: I51879ba1cac651a80ff5c9c070ec7fe1ceea9e05 BUG: 765051 Signed-off-by: Raghavendra G <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Anand Avati <>
Diffstat (limited to 'xlators/protocol/client/src/client-handshake.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index c08faccc7..f5f056c6a 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -1700,6 +1700,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;