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

Synchronize Measurements.getSummary() method to prevent ConcurrentModificationExceptions #207

Merged
merged 1 commit into from
May 18, 2015
Merged

Synchronize Measurements.getSummary() method to prevent ConcurrentModificationExceptions #207

merged 1 commit into from
May 18, 2015

Conversation

0xl3x1
Copy link
Contributor

@0xl3x1 0xl3x1 commented Jan 21, 2015

Previously the method Measurements.getSummary() wasn't set to synchronized, which was occasionally resulting in java.util.ConcurrentModificationException being raised when running YCSB with multiple threads. This commit fixes the issue by simply adding the synchronized keyword to Measurements.getSummary().

Let me know if you can think of any potential issues with making this change. I'm unsure if getSummary() was deliberately left unsynchronized for a reason?

@0xl3x1
Copy link
Contributor Author

0xl3x1 commented Feb 2, 2015

Similarly to #209, the build failure here is caused by #152, #181.

@busbey
Copy link
Collaborator

busbey commented May 17, 2015

restarted CI build.

Won't this have a big perf impact?

@0xl3x1
Copy link
Contributor Author

0xl3x1 commented May 17, 2015

@busbey I haven't witnessed any major performance impact, but I could be missing something. As far as I can see, Measurements.getSummary() is only called here every 10 seconds.

@busbey
Copy link
Collaborator

busbey commented May 17, 2015

that's a good point. There's also enough going wrong with synchronization across the rest of the class that this probably won't matter. hopefully all of this will get fixed by #214.

Doesn't exportMeasurements have the same problem?

@0xl3x1
Copy link
Contributor Author

0xl3x1 commented May 18, 2015

@busbey exportMeasurements may also have a synchronisation issue, but I haven't been using the exporter so am unsure and can't confirm the bug.

@busbey
Copy link
Collaborator

busbey commented May 18, 2015

Filed #249 for the other method.

busbey added a commit that referenced this pull request May 18, 2015
…d-keyword-in-measurements

Synchronize Measurements.getSummary() method to prevent ConcurrentModificationExceptions
@busbey busbey merged commit 99c3836 into brianfrankcooper:master May 18, 2015
@busbey
Copy link
Collaborator

busbey commented May 18, 2015

Thanks for the fix!

jaricftw pushed a commit to jaricftw/YCSB that referenced this pull request Jul 19, 2016
…sing-synchronized-keyword-in-measurements

Synchronize Measurements.getSummary() method to prevent ConcurrentModificationExceptions
jaricftw pushed a commit to jaricftw/YCSB that referenced this pull request Jul 19, 2016
…sing-synchronized-keyword-in-measurements

Synchronize Measurements.getSummary() method to prevent ConcurrentModificationExceptions
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.

2 participants