Skip to content

feat: details on detect duplicate leaf node connection#7869

Open
Naymi wants to merge 1 commit intonats-io:mainfrom
Naymi:main
Open

feat: details on detect duplicate leaf node connection#7869
Naymi wants to merge 1 commit intonats-io:mainfrom
Naymi:main

Conversation

@Naymi
Copy link
Copy Markdown

@Naymi Naymi commented Feb 24, 2026

Current Behavior:
When a duplicate leaf node connection is detected, the server logs only a generic warning message without any identifying context about the server, cluster, or account involved.

New Behavior:
The log message now includes the remote server name, cluster name, and account name associated with the duplicate leaf node connection, making it easier for operators to quickly identify and resolve connectivity issues.

Example log output:

text
[WRN] Duplicate leafnode connection detected - remoteServer: srv-eu-01, remoteCluster: prod-eu, remoteAccount: ACZ7W2J
Changes
Enhanced the duplicate leaf node detection error message to include:

Remote server name (old.leaf.remoteServer)

Remote cluster name (old.leaf.remoteCluster)

Remote account name (old.leaf.remoteAccName)

Used string concatenation to maintain backward compatibility while adding contextual information

Why This Matters
In production environments with multiple servers, clusters, and accounts, duplicate leaf node connections can be challenging to debug. This enhancement reduces mean-time-to-resolution (MTTR) by providing immediate context about which server, cluster, and account are affected, allowing operators to:

Quickly identify problematic leaf nodes across geographical deployments

Better correlate logs with monitoring tools

Proactively detect misconfigured leaf nodes or network issues

Resolves #7868

Sign-off
I have read and understood the guidelines and I certify that this submission complies with the DCO and is submitted under the Apache 2.0 license.

Signed-off-by: Naymi x19254981121@gmail.com

@Naymi Naymi requested a review from a team as a code owner February 24, 2026 09:47
Copy link
Copy Markdown
Member

@MauriceVanVeen MauriceVanVeen left a comment

Choose a reason for hiding this comment

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

The error message must not be changed as that breaks backward-compatibility. This error is sent to the client and logged on the current server.

The server already logs the user, account, remote server name, etc. isn't this sufficient?
See also: #7868 (comment)

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.

Details on duplicate leafnode connection

2 participants