From 92754cd1d12cdda18b27911f3e50eabd907edce6 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 8 Oct 2012 14:16:21 +0530 Subject: 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: http://review.gluster.org/4044 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/protocol/client/src/client-handshake.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/protocol/client') 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; -- cgit