koush / ion

Android Asynchronous Networking and Image Loading
Other
6.29k stars 1.03k forks source link

Another ConcurrentModificationException #918

Open djdance opened 4 years ago

djdance commented 4 years ago

Hello, I am getting this one from different users and different phones, but in the same place. According to breakpoints, it occurs in 100ms after Ion.with(this).load(s), and onCompleted(Exception e, JsonObject result) doesn't executed. Could you assume, what's wrong?

java.util.ConcurrentModificationException
    at com.google.gson.internal.LinkedTreeMap$LinkedTreeMapIterator.nextNode(LinkedTreeMap.java:544)
    at com.google.gson.internal.LinkedTreeMap$EntrySet$1.next(LinkedTreeMap.java:568)
    at com.google.gson.internal.LinkedTreeMap$EntrySet$1.next(LinkedTreeMap.java:566)
    at com.google.gson.internal.bind.TypeAdapters$29.write(TypeAdapters.java:758)
    at com.google.gson.internal.bind.TypeAdapters$29.write(TypeAdapters.java:698)
    at com.google.gson.internal.Streams.write(Streams.java:72)
    at com.google.gson.JsonElement.toString(JsonElement.java:316)
    at com.koushikdutta.ion.gson.GsonBody.length(GsonBody.java:55)
    at com.koushikdutta.async.http.HttpTransportMiddleware.exchangeHeaders(HttpTransportMiddleware.java:31)
    at com.koushikdutta.async.http.AsyncHttpClient.executeSocket(AsyncHttpClient.java:491)
    at com.koushikdutta.async.http.AsyncHttpClient.access$300(AsyncHttpClient.java:50)
    at com.koushikdutta.async.http.AsyncHttpClient$3.onConnectCompleted(AsyncHttpClient.java:285)
    at com.koushikdutta.async.http.AsyncSocketMiddleware.getSocket(AsyncSocketMiddleware.java:156)
    at com.koushikdutta.async.http.spdy.SpdyMiddleware.getSocket(SpdyMiddleware.java:334)
    at com.koushikdutta.async.http.AsyncHttpClient.executeAffinity(AsyncHttpClient.java:300)
    at com.koushikdutta.async.http.AsyncHttpClient.access$100(AsyncHttpClient.java:50)
    at com.koushikdutta.async.http.AsyncHttpClient$1.run(AsyncHttpClient.java:189)
    at com.koushikdutta.async.AsyncServer$Scheduled.run(AsyncServer.java:236)
    at com.koushikdutta.async.AsyncServer.lockAndRunQueue(AsyncServer.java:788)
    at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:806)
    at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:717)
    at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:46

I saw same previous reports (concerning bitmap & UI thread). I use to run few UI things right from FutureCallback() { onCompleted() } - is it okay? I thought yes.

Thanks anyway.

djdance commented 4 years ago

version 3.0.8.
before I was on 2.2.1 and it was always fine.

djdance commented 4 years ago

I can report after two months of downgrading back to 2.2.1, that no any ConcurrentModificationException crash occured among thousands of my users. So it could be better to fix it in versions 3.x