From d117466422b2fe97390b9ccc7a3c277e7a64285a Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 1 Mar 2016 13:04:03 +0530 Subject: socket: Launch socket_poller only if connect succeeded For an encrypted connection, sockect_connect() used to launch socket_poller() in it's own thread (ON by default), even if the connect failed. This would cause two unrefs to be done on the transport, once in socket_poller() and once in socket_connect(), causing the transport to be freed and cleaned up. This would cause further reconnect attempts from failing as the transport wouldn't be available. By starting socket_poller() only if connect succeeded, this is avoided. Change-Id: Ie22090dbb1833bdd0f636a76cb3935d766711917 BUG: 1313206 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/13554 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G --- rpc/rpc-transport/socket/src/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc/rpc-transport') diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index be264fb7ce8..f00657bde4c 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -3074,7 +3074,7 @@ handler: rpc_transport_ref (this); refd = _gf_true; - if (priv->own_thread) { + if (!ret && priv->own_thread) { if (pipe(priv->pipe) < 0) { gf_log(this->name,GF_LOG_ERROR, "could not create pipe"); -- cgit