Skip to content

[FIXED] LDM results in max connections exceeded errors#7527

Merged
neilalexander merged 1 commit intomainfrom
maurice/ldm-max-conns
Nov 7, 2025
Merged

[FIXED] LDM results in max connections exceeded errors#7527
neilalexander merged 1 commit intomainfrom
maurice/ldm-max-conns

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

An account using the maximum connections setting means that particular account can only have N connections connected at the same time. A server going into "Lame Duck Mode" will slowly start forcing clients to reconnect to other servers. However, these closed connections would not be deducted from counting against the account limit. Every reconnected client would be counted twice during the LDM duration. If the amount of connections was close to the limit, lots of connections that weren't reconnected yet would instead receive the maximum account active connections exceeded error.

This PR fixes this condition by continuing to do the full accounting, even while LDM is active. Only if the server is shutting down with s.Shutdown() will it close any remaining clients without needing to do the accounting.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner November 7, 2025 12:46
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit b7215dc into main Nov 7, 2025
111 of 114 checks passed
@neilalexander neilalexander deleted the maurice/ldm-max-conns branch November 7, 2025 13:13
neilalexander added a commit that referenced this pull request Nov 7, 2025
Includes the following:

- #7518
- #7519
- #7520
- #7521
- #7522
- #7523
- #7517
- #7525
- #7526
- #7527
- #7524

Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander added a commit that referenced this pull request Nov 7, 2025
Includes the following:

- #7518
- #7519
- #7520
- #7521
- #7522
- #7523
- #7517
- #7525
- #7526
- #7527
- #7524

Signed-off-by: Neil Twigg <neil@nats.io>
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.

2 participants