Add max connection info while waiting one backend connection failed

This commit is contained in:
wangbin 2023-04-25 20:26:18 +08:00
parent 1f8a3a5243
commit 452e00d2df
2 changed files with 15 additions and 12 deletions

View File

@ -355,20 +355,21 @@ network_read_sql_resp(int G_GNUC_UNUSED fd, short events, void *user_data)
packet.data = chunk->data;
packet.offset = 0;
int is_finished = network_mysqld_proto_get_query_result(&packet, con);
int is_finished =
network_mysqld_proto_get_query_result(&packet, con);
if (is_finished == 1) {
g_debug("%s: read finished", G_STRLOC);
break;
g_debug("%s: read finished", G_STRLOC);
break;
}
ret = network_mysqld_con_get_packet(con->srv, sock);
}
}
if (con->servers == NULL) {
if (con->servers == NULL) {
con->servers = g_ptr_array_new();
}
}
g_ptr_array_add(con->servers, sock);
g_ptr_array_add(con->servers, sock);
}
} else {

View File

@ -2585,12 +2585,14 @@ handle_read_query(network_mysqld_con *con, network_mysqld_con_state_t ostate)
}
/* fall through */
default:
g_critical("%s: wait failed and no server backend for user:%s, ret:%d",
G_STRLOC, con->client->response->username->str, ret);
g_critical("%s: wait failed and no server backend for user:%s, ret:%d, "
"max conn:%d",
G_STRLOC, con->client->response->username->str, ret,
con->srv->max_idle_connections);
handle_query_wait_stats(con);
process_service_unavailable(con);
break;
handle_query_wait_stats(con);
process_service_unavailable(con);
break;
}
/**