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

protect storage writes #200

Merged
merged 3 commits into from
Sep 4, 2019
Merged

protect storage writes #200

merged 3 commits into from
Sep 4, 2019

Conversation

TheL1ne
Copy link
Contributor

@TheL1ne TheL1ne commented Aug 23, 2019

We are creating multiple processors in a short time in our tests and they are failing sometimes because of concurrent map writes. We think we traced the problem to this point.

@TheL1ne TheL1ne self-assigned this Aug 23, 2019
ubunatic
ubunatic previously approved these changes Aug 23, 2019
Copy link

@ubunatic ubunatic left a comment

Choose a reason for hiding this comment

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

LGTM

@ubunatic ubunatic requested a review from db7 August 23, 2019 14:45
Copy link
Contributor

@frairon frairon left a comment

Choose a reason for hiding this comment

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

Protecting that makes sense absolutely, but if you only protect that one code branch we might only buy some time and the problem will reappear later. So I suggest using the lock everywhere mStorages is used. Use RLock/RUnlock when reading only and Lock/Unlock for writing.

@ubunatic
Copy link

Protecting that makes sense absolutely, but if you only protect that one code branch we might only buy some time and the problem will reappear later. So I suggest using the lock everywhere mStorages is used. Use RLock/RUnlock when reading only and Lock/Unlock for writing.

Sounds great!
@TheL1ne Please implement it as proposed.

@TheL1ne
Copy link
Contributor Author

TheL1ne commented Aug 28, 2019

@frairon did you meant it the way it is now?

I also did a similar thing for the in-memory storage defined outside of the tester because I think a similar problem could occur.

@TheL1ne TheL1ne merged commit 80207ca into master Sep 4, 2019
@TheL1ne TheL1ne deleted the protect_storage_writes branch September 4, 2019 09:28
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