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

ConcurrentModificationException when resuming requests #303

Closed
mjurkus opened this issue Jan 9, 2015 · 3 comments
Closed

ConcurrentModificationException when resuming requests #303

mjurkus opened this issue Jan 9, 2015 · 3 comments
Labels
Milestone

Comments

@mjurkus
Copy link

mjurkus commented Jan 9, 2015

I have a scroll listener that pauses/resumes request loading when ListView is flinged.

And from time to time I keep getting crash like this:

java.util.ConcurrentModificationException
       at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
       at com.bumptech.glide.manager.RequestTracker.resumeRequests(RequestTracker.java:68)
       at com.bumptech.glide.RequestManager.resumeRequests(RequestManager.java:142)

Using version 3.4.0.

@sjudd
Copy link
Collaborator

sjudd commented Jan 9, 2015

Are you starting or canceling new requests when other requests complete? To do so you'd either have to be starting or canceling requests in a custom Target or RequestListener.

@neworld
Copy link

neworld commented Jan 12, 2015

If I understand correctly this happens when one thread add item to queue while other thread is in progress of resuming (technically iterating through map)

@sjudd
Copy link
Collaborator

sjudd commented Jan 15, 2015

All of these methods are only called on the main thread. The concurrent modification exception occurs because calling resume on a request() either adds or removes an existing request from the tracker. I don't think Glide does this by default, but if you start or cancel a request when another request finishes, that's one way this might happen.

@sjudd sjudd added the bug label Jan 15, 2015
@sjudd sjudd closed this as completed in 9456192 Jan 20, 2015
@sjudd sjudd added this to the 3.5 milestone Jan 21, 2015
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

3 participants