summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-transport/socket/src/socket.c1
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c8
-rw-r--r--xlators/protocol/server/src/server.c8
3 files changed, 17 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 38b4d6949fc..d7b639c95ee 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -2684,6 +2684,7 @@ socket_server_event_handler (int fd, int idx, void *data,
GF_FREE (new_trans);
goto unlock;
}
+ INIT_LIST_HEAD (&new_trans->list);
new_trans->name = gf_strdup (this->name);
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 3cac55b91bd..b33cc27dde7 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -340,6 +340,14 @@ glusterd_rpcsvc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event,
}
case RPCSVC_EVENT_DISCONNECT:
{
+ /* A DISCONNECT event could come without an ACCEPT event
+ * happening for this transport. This happens when the server is
+ * expecting encrypted connections by the client tries to
+ * connect unecnrypted
+ */
+ if (list_empty (&xprt->list))
+ break;
+
pthread_mutex_lock (&priv->xprt_lock);
list_del (&xprt->list);
pthread_mutex_unlock (&priv->xprt_lock);
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 7522c4759f5..a8329cf80dc 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -513,6 +513,14 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event,
break;
}
case RPCSVC_EVENT_DISCONNECT:
+ /* A DISCONNECT event could come without an ACCEPT event
+ * happening for this transport. This happens when the server is
+ * expecting encrypted connections by the client tries to
+ * connect unecnrypted
+ */
+ if (list_empty (&trans->list))
+ break;
+
/* transport has to be removed from the list upon disconnect
* irrespective of whether lock self heal is off or on, since
* new transport will be created upon reconnect.