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 ConcurrentModificationException when attempting to update local broker data #10347

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

315157973
Copy link
Contributor

@315157973 315157973 commented Apr 23, 2021

Fixes #10229

Motivation

updateLocalBrokerData will be called concurrently in the REST API
writeBrokerDataOnZooKeeper will be called concurrently in REST API and Scheduled Task

It is not enough to ensure the thread safety of every API in LocalBrokerData.
It is necessary to ensure the thread safety of multiple APIs in LocalBrokerData at the same time.
So I added the lock to the two methods above.

@codelipenghui codelipenghui added the type/bug The PR fixed a bug or issue reported a bug label Apr 28, 2021
@codelipenghui codelipenghui added this to the 2.8.0 milestone Apr 28, 2021
@codelipenghui codelipenghui merged commit aa8f928 into apache:master Apr 28, 2021
@315157973 315157973 deleted the ConcurrentModification branch May 11, 2021 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when attempting to update local broker data
3 participants