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

Concurrent Modification Synchronization issue #174

Closed
campnic opened this issue Feb 18, 2013 · 1 comment
Closed

Concurrent Modification Synchronization issue #174

campnic opened this issue Feb 18, 2013 · 1 comment
Labels

Comments

@campnic
Copy link

campnic commented Feb 18, 2013

The MemoryCacheUtil. findCacheKeysForImageUri methods iterate over a synchronized list without obtaining the lock to synchronize on the synchronized list. Per http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collections.html#synchronizedList(java.util.List) you have to synchronize on the list when you iterate the items. This also seems to apply to getKeys which is used in these methods. I've hit an exception a few dozen times in testing where this caused a crash.

An option for a fix would be to copy the keys to an immutable collection before iteration. I cannot submit a patch at the moment, but would be happy to in a week or so if no one can tackle it before then.

@nostra13
Copy link
Owner

Ok, thanks, I look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants