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

fix discovery interval data race #34

Merged
merged 3 commits into from
Aug 2, 2022
Merged

Conversation

rlankfo
Copy link
Member

@rlankfo rlankfo commented Aug 1, 2022

This PR read locks the endpoint's collectMux RWMutex when reading data from the endpoint object map. This prevents race conditions when discovery interval != 0 because data can no longer be read while the object maps are rewritten during discovery.

This PR also adds resources to the test's simulator VPX model, adds logging to the test, and sets a 60 second discovery interval for the exporter under test.

@rlankfo rlankfo requested a review from marctc August 1, 2022 19:44
Copy link
Contributor

@marctc marctc left a comment

Choose a reason for hiding this comment

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

LGTM, not sure why tests are failing tho

@rlankfo
Copy link
Member Author

rlankfo commented Aug 2, 2022

LGTM, not sure why tests are failing tho

I'm re-running them -- I notice this happens once in a while and I assume it's because the simulator doesn't generate these metrics sometimes.

@rlankfo rlankfo merged commit eea0496 into main Aug 2, 2022
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.

discovery interval data race
2 participants