Skip to content

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

Merged
neilalexander merged 1 commit intomainfrom
neil/userinfo
Jul 22, 2025
Merged

[FIXED] Ensure $SYS.REQ.USER.INFO is only answered by correct server#7089
neilalexander merged 1 commit intomainfrom
neil/userinfo

Conversation

@neilalexander
Copy link
Copy Markdown
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 neil@nats.io

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

LGTM

server/events.go Outdated

// 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
Copy Markdown
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
Copy Markdown
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 <neil@nats.io>
Copy link
Copy Markdown
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 <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.

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