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

Fixes races accessing node and updating it during fingerprinting #4162

Closed
wants to merge 5 commits into from

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Apr 16, 2018

Fixes #4154

Copy link
Contributor

@chelseakomlo chelseakomlo left a 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)
Copy link
Contributor

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

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.
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already states that.

@dadgar
Copy link
Contributor Author

dadgar commented Apr 17, 2018

Closing in favor of #4166

@dadgar dadgar closed this Apr 17, 2018
@dadgar dadgar deleted the b-panic-fix branch April 17, 2018 17:02
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants