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
Leafnode updates #980
Leafnode updates #980
Conversation
Signed-off-by: Derek Collison <derek@nats.io>
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 - although a bit nervous about not locking and more importantly not checking sl
for nil.
server/leafnode.go
Outdated
gws := gwsa[:0] | ||
s.getOutboundGatewayConnections(&gws) | ||
for _, cgw := range gws { | ||
if ei, _ := cgw.gw.outsim.Load(accName); ei != 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.
I believe that we don't need indeed to cgw.mu.Lock()/Unlock() here since cgw.gw is set when the object is initialized and I don't think I ever set it to nil.
Same for accessing ei.(*outsie).sl.All()
without checking if sl is nil or not. sl
should be initialized when an entry is added in the map, at least in the "gateway-only" code path. Since we have now trigger some gateway code from leafnode conditions, I am not entirely sure that this is always the case.
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.
Will take a look. I can lock it down more.
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.
Will fix.
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.
Take a look now..
Signed-off-by: Derek Collison <derek@nats.io>
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
Various fixes for panics in auth event handling and leafnodes.
Added gateway interest for smap handling for leafnodes.
Signed-off-by: Derek Collison derek@nats.io
/cc @nats-io/core