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

Leafnode updates #980

Merged
merged 2 commits into from May 2, 2019
Merged

Leafnode updates #980

merged 2 commits into from May 2, 2019

Conversation

derekcollison
Copy link
Member

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

Signed-off-by: Derek Collison <derek@nats.io>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.006%) to 90.764% when pulling 5292ec1 on leafupdates into 220330d on master.

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 - although a bit nervous about not locking and more importantly not checking sl for nil.

gws := gwsa[:0]
s.getOutboundGatewayConnections(&gws)
for _, cgw := range gws {
if ei, _ := cgw.gw.outsim.Load(accName); ei != nil {
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix.

Copy link
Member Author

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

@derekcollison derekcollison merged commit dacf0a4 into master May 2, 2019
@derekcollison derekcollison deleted the leafupdates branch May 2, 2019 22:47
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