-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[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
Conversation
There was a problem hiding this 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() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
47b01c2
to
84b7c8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
$SYS.REQ.USER.INFO
is only answered by correct server$SYS.REQ.USER.INFO
is only answered by correct server
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]>
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]