glusterfs/0257-rpc-rearm-listener-socket-early.patch
Milind Changire 312c9bafe1 autobuild v3.12.2-9
Resolves: bz#1546717 bz#1557551 bz#1558948 bz#1561999 bz#1563804
Resolves: bz#1565015 bz#1565119 bz#1565399 bz#1565577 bz#1567100
Resolves: bz#1567899 bz#1568374 bz#1568969 bz#1569490 bz#1570514
Resolves: bz#1570541 bz#1570582 bz#1571645 bz#1572087 bz#1572585
Resolves: bz#1575895
Signed-off-by: Milind Changire <mchangir@redhat.com>
2018-05-09 08:42:05 -04:00

58 lines
2.1 KiB
Diff

From 8879d72884396de4ae2ff41649de5f2d916d272b Mon Sep 17 00:00:00 2001
From: Milind Changire <mchangir@redhat.com>
Date: Fri, 13 Apr 2018 10:53:46 +0530
Subject: [PATCH 257/260] 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.
mainline:
> Reviewed-on: https://review.gluster.org/19833
> Change-Id: Ibed421e50284c3f7a8fcdb4de7ac86cf53d4b74e
> fixes: bz#1564600
> Signed-off-by: Milind Changire <mchangir@redhat.com>
Change-Id: I4bf45b8a12f738ed9b398246e22dfd29e6b1010c
BUG: 1563804
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/135513
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
---
rpc/rpc-transport/socket/src/socket.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index a6be911..b98efdc 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -2746,6 +2746,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)",
@@ -2968,8 +2971,6 @@ socket_server_event_handler (int fd, int idx, int gen, void *data,
}
}
out:
- event_handled (ctx->event_pool, fd, idx, gen);
-
if (cname && (cname != this->ssl_name)) {
GF_FREE(cname);
}
--
1.8.3.1