Skip to content
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

Merged
merged 5 commits into from
Apr 16, 2022

Conversation

matthiashanel
Copy link
Contributor

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.

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>
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM


sysNc := natsConnect(t, s.ClientURL(), sUsr, disconnectCb)
defer sysNc.Close()
defer sysNc.SetDisconnectErrHandler(nil)
Copy link
Member

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()

Copy link
Member

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.

Copy link
Contributor Author

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() {
Copy link
Member

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.

@matthiashanel matthiashanel merged commit 7752a5b into main Apr 16, 2022
@matthiashanel matthiashanel deleted the mixed-sys-update branch April 16, 2022 19:09
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.

None yet

3 participants