Changeset: 6e8087cb5902 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6e8087cb5902 Modified Files: documentation/source/manual_pages/monetdbd.rst.in tools/merovingian/ChangeLog.Aug2024 tools/merovingian/daemon/client.c tools/merovingian/daemon/merovingian.c tools/merovingian/daemon/monetdbd.1.in Branch: Aug2024 Log Message:
Revert "Tweak socket parameters to simulate network activity on client connections" diffs (138 lines): diff --git a/documentation/source/manual_pages/monetdbd.rst.in b/documentation/source/manual_pages/monetdbd.rst.in --- a/documentation/source/manual_pages/monetdbd.rst.in +++ b/documentation/source/manual_pages/monetdbd.rst.in @@ -251,17 +251,6 @@ using the **set** command. The following use redirects instead of proxies. Changing this property takes effect immediately at runtime. -**keepalive** - Specifies the keepalive interval for incoming connections. If this is - set to a positive number, *monetdbd* configures the system to send - automatic periodic keepalive probes on all client connections. This - can help keep firewalls from killing connections that seem idle but - are in fact waiting for a long running query to finish. The default - is 60 seconds. When 127 consecutive probes have failed, the - connection is closed. With the default setting of 60 seconds this - means the connection is closed when the client has been unreachable - for more than two hours. - REMOTE DATABASES ================ diff --git a/tools/merovingian/ChangeLog.Aug2024 b/tools/merovingian/ChangeLog.Aug2024 --- a/tools/merovingian/ChangeLog.Aug2024 +++ b/tools/merovingian/ChangeLog.Aug2024 @@ -1,8 +1,3 @@ # ChangeLog file for sql/src/backends/monet5/merovingian # This file is updated with mchangelog -* Mon Oct 7 2024 Joeri van Ruth <joeri.van.r...@monetdbsolutions.com> -- Tweak socket parameters to simulate network activity on client connections. - This prevents firewalls from killing connections that seem idle but are - actually waiting for a long-running query. Can be controlled with a new - 'keepalive' option to monetdbd. diff --git a/tools/merovingian/daemon/client.c b/tools/merovingian/daemon/client.c --- a/tools/merovingian/daemon/client.c +++ b/tools/merovingian/daemon/client.c @@ -18,7 +18,6 @@ #include <sys/un.h> #include <netdb.h> #include <netinet/in.h> -#include <netinet/tcp.h> #ifdef HAVE_POLL_H #include <poll.h> #endif @@ -58,8 +57,6 @@ struct clientdata { char challenge[32]; }; -static void configureKeepAlive(int sock, int keepalive); - static void * handleClient(void *data) { @@ -83,7 +80,6 @@ handleClient(void *data) int sock; bool isusock; struct threads *self; - int keepalive; #ifdef HAVE_PTHREAD_SETNAME_NP pthread_setname_np( @@ -98,11 +94,6 @@ handleClient(void *data) self = ((struct clientdata *) data)->self; memcpy(chal, ((struct clientdata *) data)->challenge, sizeof(chal)); free(data); - - keepalive = getConfNum(_mero_props, "keepalive"); - if (keepalive > 0) - configureKeepAlive(sock, keepalive); - fdin = socket_rstream(sock, "merovingian<-client (read)"); if (fdin == NULL) { self->dead = true; @@ -670,29 +661,3 @@ error: } return(newErr("accept connection: %s", msg)); } - -static void -configureKeepAlive(int sock, const int keepalive) -{ - if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, &keepalive, sizeof(keepalive)) < 0) { - Mlevelfprintf(WARNING, _mero_ctlerr, "could not set TCP_KEEPIDLE on socket: %s", strerror(errno)); - return; - } - - if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL, &keepalive, sizeof(keepalive)) < 0) { - Mlevelfprintf(WARNING, _mero_ctlerr, "could not set TCP_KEEPINTVL on socket: %s", strerror(errno)); - return; - } - - const int keepcnt = 127; // fixed value, maximum allowed - if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt)) < 0) { - Mlevelfprintf(WARNING, _mero_ctlerr, "could not set TCP_KEEPCNT on socket: %s", strerror(errno)); - return; - } - - const int enabled = 1; - if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enabled, sizeof(enabled)) < 0) { - Mlevelfprintf(WARNING, _mero_ctlerr, "could not set SO_KEEPALIVE on socket: %s", strerror(errno)); - return; - } -} diff --git a/tools/merovingian/daemon/merovingian.c b/tools/merovingian/daemon/merovingian.c --- a/tools/merovingian/daemon/merovingian.c +++ b/tools/merovingian/daemon/merovingian.c @@ -461,7 +461,6 @@ main(int argc, char *argv[]) #else {"snapshotcompression", strdup(".tar"), 0, STR}, #endif - {"keepalive", strdup("60"), 60, INT}, { NULL, NULL, 0, INVALID} }; diff --git a/tools/merovingian/daemon/monetdbd.1.in b/tools/merovingian/daemon/monetdbd.1.in --- a/tools/merovingian/daemon/monetdbd.1.in +++ b/tools/merovingian/daemon/monetdbd.1.in @@ -388,20 +388,6 @@ approach, but still hides away the mserv Hence, in practice it is only relevant for connections to remote databases to use redirects instead of proxies. Changing this property takes effect immediately at runtime. -.TP -.B keepalive -Specifies the keepalive interval for incoming connections. -If this is set to a positive number, -.I monetdbd -configures the system to send automatic periodic keepalive -probes on all client connections. This can help keep firewalls -from killing connections that seem idle but are in fact waiting -for a long running query to finish. -The default is 60 seconds. -When 127 consecutive probes have failed, the connection is closed. -With the default setting of 60 seconds this means the connection -is closed when the client has been unreachable for more than two -hours. .SH REMOTE DATABASES .B Deprecation notice: This feature is deprecated and may be removed in the future. _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org