Skip to content

Commit

Permalink
Issue 6296 - basic_test.py::test_conn_limits fails in main branch (#6300
Browse files Browse the repository at this point in the history
)

Description:
A CI test to validate connection management functionality by
configuring an instance with a very small connection table fails,
with the instance failing to start.

Fix description:
In a multi list connection table configuration, the connection table
code has been updated to expand the connection table size to include
a head for each list. This expanded size needs to be accounted for
when we determine if we can accept new connections and on final check
at server starup time.

Relates: #6296

Reviewed by: @droideck  (Thank you)
  • Loading branch information
jchapma committed Aug 29, 2024
1 parent 2b06fd2 commit e322605
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ldap/servers/slapd/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,8 @@ accept_thread(void *vports)
num_poll = setup_pr_accept_pds(n_tcps, s_tcps, i_unix, &fds);

while (!g_get_shutdown()) {
/* Do we need to accept new connections? */
int accept_new_connections = (ct->size > ct->conn_next_offset);
/* Do we need to accept new connections, account for ct->size including list heads. */
int accept_new_connections = ((ct->size - ct->list_num) > ct->conn_next_offset);
if (!accept_new_connections) {
if (last_accept_new_connections) {
slapi_log_err(SLAPI_LOG_ERR, "accept_thread",
Expand Down Expand Up @@ -2036,8 +2036,8 @@ unfurl_banners(Connection_Table *ct, daemon_ports_t *ports, PRFileDesc **n_tcps,
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
char addrbuf[256];
int isfirsttime = 1;

if (ct->size > (slapdFrontendConfig->maxdescriptors - slapdFrontendConfig->reservedescriptors)) {
/* Take into account that ct->size includes a list head for each listener. */
if ((ct->size - ct->list_num) > (slapdFrontendConfig->maxdescriptors - slapdFrontendConfig->reservedescriptors)) {
slapi_log_err(SLAPI_LOG_ERR, "slapd_daemon",
"Not enough descriptors to accept any connections. "
"This may be because the maxdescriptors configuration "
Expand Down

0 comments on commit e322605

Please sign in to comment.