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

only lock mutex while accessing auth map on runner server #1274

Conversation

James-Pickett
Copy link
Contributor

No description provided.

@James-Pickett James-Pickett marked this pull request as ready for review August 1, 2023 17:32
@James-Pickett James-Pickett changed the title only lock mutex while accessing on runner server only lock mutex while accessing auth map on runner server Aug 1, 2023
Comment on lines 136 to 139
// not using defer here because this function
// calls the next function rather than returing,
// this blocks mutex for too long
ms.mutex.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is okay -- there's no return earlier here. But at 13 lines between the Lock and the Unlock, I feel nervous about it surviving a refactor. Do you think this makes sense as-is, or can we push this section into a new method with a deferred unlock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, moved to separate func with defer unlock

@James-Pickett James-Pickett merged commit 55dd7bf into kolide:main Aug 1, 2023
@James-Pickett James-Pickett deleted the james/release-runner-server-mutex-faster branch August 1, 2023 18:20
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.

3 participants