Exceeding max connections does not return an error like MySQL does
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 120
Description
Dolt v1.82.4
Running dolt sql-sever with max conns 1 then running two connections does not return a 'Too many connections' error like MySQL does, it just
silently blocks.
```bash
2026/02/26 10:25:07 [conn-2] connected; running SELECT SLEEP(10)
2026/02/26 10:25:17 [conn-2] done (SLEEP returned 0)
2026/02/26 10:25:17 [conn-1] connected; running SELECT SLEEP(10)
2026/02/26 10:25:27 [conn-1] done (SLEEP returned 0)
```
Looks like Dolt prints a server warning in loglevel debug, but nothing is reported to the clients
```bash
INFO[0232] NewConnection DisableClientMultiStatements=false connectionID=20
INFO[0232] ConnectionClosed connectionID=20
WARN[0404] max connections reached. Clients waiting. Increase server max_connections
INFO[0404] NewConnection DisableClientMultiStatements=false connectionID=21
DEBU[0404] Starting query connectTime="2026-02-26 10:25:07.224484306 -0800 PST m=+404.831485334" connectionDb=db connectionID=21 query="SELECT SLEEP(10)" queryTime="2026-02-26 10:25:07.224706464 -0800 PST m=+404.831707492"
DEBU[0414] Query finished in 10000 ms connectTime="2026-02-26 10:25:07.224484306 -0800 PST m=+404.831485334" connectionDb=db connectionID=21 query="SELECT SLEEP(10)" queryTime="2026-02-26 10:25:17.225437518 -0800 PST m=+414.832438577"
INFO[0414] ConnectionClosed connectionID=21
INFO[0414] NewConnection DisableClientMultiStatements=false connectionID=22
DEBU[0414] Starting query connectTime="2026-02-26 10:25:17.226775504 -0800 PST m=+414.833776532" connectionDb=db connectionID=22 query="SELECT SLEEP(10)" queryTime="2026-02-26 10:25:17.227004114 -0800 PST m=+414.834005142"
DEBU[0424] Query finished in 10000 ms connectTime="2026-02-26 10:25:17.226775504 -0800 PST m=+414.833776532" connectionDb=db connectionID=22 query="SELECT SLEEP(10)" queryTime="2026-02-26 10:25:27.227847894 -0800 PST m=+424.834848952"
INFO[0424] ConnectionClosed connectionID=22
^CINFO[0573] Server closing listener. No longer accepting connections.
```
versus MySQL
```bash
2026/02/26 10:45:06 [conn-2] conn acquire error (attempt 1): Error 1040 (08004): Too many connections (backoff 200ms)
2026/02/26 10:45:06 [conn-1] conn acquire error (attempt 1): Error 1040 (08004): Too many connections (backoff 200ms)
2026/02/26 10:45:07 [conn-2] connected; running SELECT SLEEP(10)
2026/02/26 10:45:07 [conn-1] conn acquire error (attempt 2): Error 1040 (08004): Too many connections (backoff 400ms)
2026/02/26 10:45:07 [conn-1] conn acquire error (attempt 3): Error 1040 (08004): Too many connections (backoff 800ms)
2026/02/26 10:45:08 [conn-1] conn acquire error (attempt 4): Error 1040 (08004): Too many connections (backoff 1.6s)
2026/02/26 10:45:10 [conn-1] conn acquire error (attempt 5): Error 1040 (08004): Too many connections (backoff 3s)
2026/02/26 10:45:13 [conn-1] conn acquire error (attempt 6): Error 1040 (08004): Too many connections (backoff 3s)
2026/02/26 10:45:17 [conn-2] done (SLEEP returned 0)
2026/02/26 10:45:17 [conn-1] connected; running SELECT SLEEP(10)
2026/02/26 10:45:27 [conn-1] done (SLEEP returned 0)
````
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the `dolt sql-server` connection handling for the `max_connections` setting and trace how a client waits when the limit is reached. Compare the behavior with MySQL's “Too many connections” response; done means an excess connection receives a client-visible error instead of silently blocking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, mysql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100