Skip to content

Log a warning when max connections is hit#403

Merged
macneale4 merged 1 commit intomainfrom
macneale4/max-con-warn
Mar 18, 2025
Merged

Log a warning when max connections is hit#403
macneale4 merged 1 commit intomainfrom
macneale4/max-con-warn

Conversation

@macneale4
Copy link

@macneale4 macneale4 commented Mar 18, 2025

Fixes: dolthub/dolt#8942

Tested by configuring a server with 2 max conns, then connecting to it 3 times:

lcl:~/Documents/data_dir_1/db3$ dolt sql-server --config ./config.yaml
Starting server with Config HP="localhost:3306"|T="28800000"|R="false"|L="info"|S="/tmp/mysql.sock"
WARN[0000] unix socket set up failed: file already in use: /tmp/mysql.sock
INFO[0000] Server ready. Accepting connections.
WARN[0000] secure_file_priv is set to "", which is insecure.
WARN[0000] Any user with GRANT FILE privileges will be able to read any file which the sql-server process can read.
WARN[0000] Please consider restarting the server with secure_file_priv set to a safe (or non-existent) directory.
INFO[0004] NewConnection                                 DisableClientMultiStatements=false connectionID=1
INFO[0006] NewConnection                                 DisableClientMultiStatements=false connectionID=2
WARN[0009] max connections reached. Clients waiting. Increase server max connections

@macneale4 macneale4 requested a review from zachmu as a code owner March 18, 2025 22:14
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@macneale4 macneale4 merged commit 91d25ce into main Mar 18, 2025
4 checks passed
@Hydrocharged Hydrocharged deleted the macneale4/max-con-warn branch January 9, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log when max_connections is reached

2 participants