From f125bb78b5a2abb41dec011d2f4fd525cb57ec93 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 Backport of 92abe07 from master 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. BUG: 1314641 Change-Id: Ifd1bc4d48a8bdf741e32d02bdbac91530e0e8111 Signed-off-by: Kaushal M Originally-reviewed-on: http://review.gluster.org/13554 Reviewed-on: http://review.gluster.org/13604 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Vijay Bellur CentOS-regression: Gluster Build System --- rpc/rpc-transport/socket/src/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc') diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 21256bb15ca..6464cd79d0c 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -3078,7 +3078,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