Despite detecting and tagging them for close on config change,
the closing happened only in long-term maintenance. So there
was time where they could still be reused by clients.
Fix this by strict check in find_server()
} else {
while (1) {
server = first_socket(&pool->idle_server_list);
- if (!server || server->ready)
+ if (!server)
+ break;
+ else if (server->close_needed)
+ disconnect_server(server, true, "obsolete connection");
+ else if (!server->ready)
+ disconnect_server(server, true, "idle server got dirty");
+ else
break;
- disconnect_server(server, true, "idle server got dirty");
}
}
Assert(!server || server->state == SV_IDLE);