summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2016-03-01 13:04:03 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-03-03 20:42:14 -0800
commitd117466422b2fe97390b9ccc7a3c277e7a64285a (patch)
treed80b3554be36e8440f08a0e1f17875d9662e0297 /rpc/rpc-transport/socket
parentfdd8fc6f82e3b47eb47c82335f79552610596913 (diff)
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 <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/13554 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/socket')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c2
1 files changed, 1 insertions, 1 deletions
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");