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

Race conditions in the herd package #51

Open
vj396 opened this issue Feb 21, 2020 · 4 comments
Open

Race conditions in the herd package #51

vj396 opened this issue Feb 21, 2020 · 4 comments

Comments

@vj396
Copy link

vj396 commented Feb 21, 2020

Summary
We we have a large mdb.json file, say 100+, the dominator binary throws off a data race, when ran under the race detector.

this race condition seems to originate in dom/herd package, where a lot of read/writes are happening in a concurrency unsafe manner in the sub.go file, under methods connectAndPoll.

this originates from the usage of the derived datatype subStatus.

Is there any plan on addressing these data races, and leverage atomic operations for read/writes?

@rgooch
Copy link
Member

rgooch commented Feb 21, 2020

To reduce lock contention, there are indeed some accesses for this variable which are not locked. The reasoning behind this is that since a status variable is inherently out of date once obtained, it need not be protected by a lock for simply presenting the value on a dashboard. The variable is protected by a lock when updating or if a decision needs to be made when reading it.

Are there any observed bugs due to this, or is this strictly being raised by the race detector?

@vj396
Copy link
Author

vj396 commented Feb 21, 2020

we have hit this one time and it did cause dominator to crash

@rgooch
Copy link
Member

rgooch commented Feb 22, 2020

Can you post a full panic log? I'd like to see how the race leads to a crash.

@vj396
Copy link
Author

vj396 commented Feb 25, 2020

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

No branches or pull requests

2 participants