-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixed mixed mode server without JS dropping js export on jwt update #3044
Conversation
Signed-off-by: Matthias Hanel <mh@synadia.com>
Signed-off-by: Matthias Hanel <mh@synadia.com>
Signed-off-by: Matthias Hanel <mh@synadia.com>
Signed-off-by: Matthias Hanel <mh@synadia.com>
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/jwt_test.go
Outdated
|
||
sysNc := natsConnect(t, s.ClientURL(), sUsr, disconnectCb) | ||
defer sysNc.Close() | ||
defer sysNc.SetDisconnectErrHandler(nil) |
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.
FYI: Instead of doing that, you could pass the option nats.NoCallbacksAfterClientClose()
in the Connect() call. With that option, the disconnect (and close) handler(s) won't be invoked in Close()
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.
And you don't need to close the disconnectChan, regardless. You are using a buffered channel, so that won't block the disconnect handler on exit, even if you were not using NoCallbacksAfterClientClose option.
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 NoCallbacksAfterClientClose instead of clearing the error handler. thanks for that tip.
I'll keep the channel close, seems off without.
Signed-off-by: Matthias Hanel <mh@synadia.com>
|
||
if s.JetStreamEnabled() { | ||
// in case of a mixed mode setup, enable js exports anyway | ||
if s.JetStreamEnabled() || !s.standAloneMode() { |
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.
Exports always need to be enabled regardless of standalone status.
Signed-off-by: Matthias Hanel mh@synadia.com
The removed code is subsequently handled by addSystemAccountExports.
Right now I am using !standalone as signal to add in the exports. But could add an option, or check for options as well.