From 7fc0e7de9fb8306e84d1c15211aba4308f694455 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 12 Apr 2022 14:45:23 -0400 Subject: Revert the addition of GetMaxBackends() and related stuff. This reverts commits 0147fc7, 4567596, aa64f23, and 5ecd018. There is no longer agreement that introducing this function was the right way to address the problem. The consensus now seems to favor trying to make a correct value for MaxBackends available to mdules executing their _PG_init() functions. Nathan Bossart Discussion: http://postgr.es/m/20220323045229.i23skfscdbvrsuxa@jrouhaud --- src/backend/libpq/pqcomm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/backend/libpq/pqcomm.c') diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 7d3dc2a51f3..03cdc72b406 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -334,7 +334,6 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber, struct addrinfo hint; int listen_index = 0; int added = 0; - int max_backends = GetMaxBackends(); #ifdef HAVE_UNIX_SOCKETS char unixSocketPath[MAXPGPATH]; @@ -557,7 +556,7 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber, * intended to provide a clamp on the request on platforms where an * overly large request provokes a kernel error (are there any?). */ - maxconn = max_backends * 2; + maxconn = MaxBackends * 2; if (maxconn > PG_SOMAXCONN) maxconn = PG_SOMAXCONN; -- cgit v1.2.3