From e0a4ea415b4b2b3e1f9877ebc6aafeb03a0d9729 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Thu, 7 Oct 2010 13:30:47 +0300 Subject: [PATCH] client_login_timeout: check wait_for_welcome When rebooting, then pool->welcome_msg_ready=0 does not mean that ->waiting_client_list will contain only new connections. --- src/janitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/janitor.c b/src/janitor.c index 3fe49ba..bed166d 100644 --- a/src/janitor.c +++ b/src/janitor.c @@ -346,6 +346,8 @@ static void pool_client_maint(PgPool *pool) if (cf_client_login_timeout > 0 && !pool->welcome_msg_ready) { statlist_for_each_safe(item, &pool->waiting_client_list, tmp) { client = container_of(item, PgSocket, head); + if (!client->wait_for_welcome) + continue; age = now - client->connect_time; if (age > cf_client_login_timeout) disconnect_client(client, true, "client_login_timeout (server down)"); -- 2.40.0