path: root/rpc/rpc-transport
diff options
authorMilind Changire <>2018-04-06 23:19:07 +0530
committerRaghavendra G <>2018-04-07 03:01:09 +0000
commit6964640a977cb10c0c95a94e03c229918fa6eca8 (patch)
tree249dd481302b4fed1382e8e2ed2da8e0532fd138 /rpc/rpc-transport
parentbb12f2109a01856e8184e13cf984210d20155b13 (diff)
rpc: rearm listener socket early
Problem: On node reboot, when glusterd starts volumes, a setup with a large number of bricks might cause SYN Flooding and connections to be dropped if the connections are not accepted quickly enough. Solution: accept() the connection and rearm the listener socket early to receive more connection requests as soon as possible. Change-Id: Ibed421e50284c3f7a8fcdb4de7ac86cf53d4b74e fixes: bz#1564600 Signed-off-by: Milind Changire <>
Diffstat (limited to 'rpc/rpc-transport')
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 256454a9515..a000b26e515 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -2893,6 +2893,9 @@ socket_server_event_handler (int fd, int idx, int gen, void *data,
if (poll_in) {
new_sock = accept (priv->sock, SA (&new_sockaddr), &addrlen);
+ if (ctx)
+ event_handled (ctx->event_pool, fd, idx, gen);
if (new_sock == -1) {
gf_log (this->name, GF_LOG_WARNING,
"accept on %d failed (%s)",
@@ -3115,9 +3118,6 @@ socket_server_event_handler (int fd, int idx, int gen, void *data,
- if (ctx)
- event_handled (ctx->event_pool, fd, idx, gen);
if (cname && (cname != this->ssl_name)) {