Description:
When the MySQL Server is shutting down, it will still accept conections and it's then possible for it ro reject that connection with a somewhat strange error message "Too many connections" instead of the "Server is shutting down"
This is most likely due to the following code in mysqld.cc, where both max_connections and abort_loop gives the same error. The abort_loop should return the "Server is shutting down" error. Well, even better would maybe be if the connection was not accepted at all?
if (connection_count >= max_connections + 1 || abort_loop)
{
pthread_mutex_unlock(&LOCK_connection_count);
DBUG_PRINT("error",("Too many connections"));
close_connection(thd, ER_CON_COUNT_ERROR, 1);
delete thd;
DBUG_VOID_RETURN;
}
How to repeat:
Start a program that continously connects to a started MySQL Server
Shut down the server.
The connecting program would get several errors and occasionally it will get the ER_CON_COUNT_ERROR
Suggested fix:
Use a separate if for abort_loop
Description: When the MySQL Server is shutting down, it will still accept conections and it's then possible for it ro reject that connection with a somewhat strange error message "Too many connections" instead of the "Server is shutting down" This is most likely due to the following code in mysqld.cc, where both max_connections and abort_loop gives the same error. The abort_loop should return the "Server is shutting down" error. Well, even better would maybe be if the connection was not accepted at all? if (connection_count >= max_connections + 1 || abort_loop) { pthread_mutex_unlock(&LOCK_connection_count); DBUG_PRINT("error",("Too many connections")); close_connection(thd, ER_CON_COUNT_ERROR, 1); delete thd; DBUG_VOID_RETURN; } How to repeat: Start a program that continously connects to a started MySQL Server Shut down the server. The connecting program would get several errors and occasionally it will get the ER_CON_COUNT_ERROR Suggested fix: Use a separate if for abort_loop