Skip to content

[FIXED] Ensure $SYS.REQ.USER.INFO is only answered by correct server #7089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

neilalexander
Copy link
Member

All servers in the cluster were unexpectedly attempting to respond, but only the server that the client is connected to would know about the auth credentials. It was effectively a race condition which response would make it back to the client first.

Fixes #7088.

Signed-off-by: Neil Twigg [email protected]

@neilalexander neilalexander requested a review from a team as a code owner July 22, 2025 10:47
Copy link
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.

LGTM

server/events.go Outdated
@@ -1495,6 +1495,12 @@ func (s *Server) userInfoReq(sub *subscription, c *client, _ *Account, subject,
return
}

// Only the server that the client is connected to should answer, otherwise
// we may not know about their connection JWT etc.
if ci.Server != s.Name() {
Copy link
Member

Choose a reason for hiding this comment

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

We have ways for subs to not propagate interest to other servers, the sub for this one should have been that I believe. Will check the original sub code for that endpoint.

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to this approach instead, seems to solve the problem more elegantly.

All servers in the cluster were unexpectedly attempting to respond, but
only the server that the client is connected to would know about the auth
credentials. It was effectively a race condition which response would make
it back to the client first.

Fixes #7088.

Signed-off-by: Neil Twigg <[email protected]>
Copy link
Member

@derekcollison derekcollison 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 43b4653 into main Jul 22, 2025
112 of 114 checks passed
@neilalexander neilalexander deleted the neil/userinfo branch July 22, 2025 13:42
@wallyqs wallyqs changed the title Ensure $SYS.REQ.USER.INFO is only answered by correct server [FIXED] Ensure $SYS.REQ.USER.INFO is only answered by correct server Jul 24, 2025
neilalexander added a commit that referenced this pull request Jul 25, 2025
Includes the following:

- #7031
- #7033
- #7034
- #7035
- #7036
- #7040
- #7043
- #7045
- #7047
- #7046
- #7050
- #7051
- #7052
- #7053
- #7061
- #7063
- #7064
- #7065
- #7066
- #7070
- #7072
- #7080
- #7026
- #6728
- #7074
- #7089
- #7095
- #7087
- #7094
- #7096
- #7099

Signed-off-by: Neil Twigg <[email protected]>
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.

Response to SYS.REQ.USER.INFO is missing 'permissions' field when request is serverd by the server that did not authenticate the user
3 participants