diff options
author | Kaushal M <kaushal@redhat.com> | 2016-03-01 13:04:03 +0530 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2016-03-09 01:10:06 -0800 |
commit | f125bb78b5a2abb41dec011d2f4fd525cb57ec93 (patch) | |
tree | d846f161d5ffd74d94f5f9f94d6a27d0cb079be8 /rpc | |
parent | 0cb6e6e7020c5a4f2e5c34c6b8cbfa4fdeb45191 (diff) |
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 <kaushal@redhat.com>
Originally-reviewed-on: http://review.gluster.org/13554
Reviewed-on: http://review.gluster.org/13604
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 2 |
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 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"); |