-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fixes races accessing node and updating it during fingerprinting #4162
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.
Looks good, this is much safer. For copying a node, if there are existing tests, we should probably have a test assertion for copying driver info.
@@ -1461,6 +1461,7 @@ func (n *Node) Copy() *Node { | |||
nn.Meta = helper.CopyMapStringString(nn.Meta) | |||
nn.Events = copyNodeEvents(n.Events) | |||
nn.DrainStrategy = nn.DrainStrategy.Copy() | |||
nn.Drivers = copyNodeDrivers(n.Drivers) |
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.
If there is a test for Copy for a node, add this to the test assertion.
@@ -1752,9 +1755,14 @@ OUTER: | |||
} | |||
} | |||
|
|||
// updateNode triggers a client to update its node copy if it isn't doing | |||
// updateNode updates the Node copy and triggers the client to send the updated | |||
// Node to the server. This should be done while holding the configLock lock. | |||
// so already |
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 don't think this last comment was meant to be included
@@ -1752,9 +1755,14 @@ OUTER: | |||
} | |||
} | |||
|
|||
// updateNode triggers a client to update its node copy if it isn't doing | |||
// updateNode updates the Node copy and triggers the client to send the updated | |||
// Node to the server. This should be done while holding the configLock lock. |
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.
Maybe specify that the caller needs to hold the configLock
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.
Already states that.
Closing in favor of #4166 |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #4154