-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
ConcurrentModificationException #52
Comments
I have never came across this issue before. The only reason I can think of is in one thread you are registering a listener and in another thread you are posting the notification simultaneously. Can you post a small reproducible code? I have a quick-fix in mind, but need to see what kind of code causes it. |
Fix is there in 2.2.0-SNAPSHOT, but I still love to see the code that causes it 😄 |
I will send it in a few hours :) |
Yes your last change is the idiomatic one. You should register listener at the beginning and listening through out the app life-cycle. I have changed the event bus code which will handle the first scenario also, but remember you may loose some events due to the inherent property of ConcurrentHashMap if the listener collection is modified while dispatching events. But this is the short-fall of the first scenario only, your second scenario is fool-proof. |
Hi again :)
I got an exception on updating object in repository:
As mentioned in documentation
What can be the reason of such exception?
The text was updated successfully, but these errors were encountered: