feat: details on detect duplicate leaf node connection#7869
Open
Naymi wants to merge 1 commit intonats-io:mainfrom
Open
feat: details on detect duplicate leaf node connection#7869Naymi wants to merge 1 commit intonats-io:mainfrom
Naymi wants to merge 1 commit intonats-io:mainfrom
Conversation
MauriceVanVeen
requested changes
Feb 24, 2026
Member
MauriceVanVeen
left a comment
There was a problem hiding this comment.
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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