You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fromJson intermittently fails with IllegalStateException when deserializing recursive structures in parallel #1829
We are seeing an issue where fromJson results in a JsonSyntaxException with the root cause being an IllegalStateException. The stacktrace that comes from within the GSON library is:
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at com.stripe.net.LiveStripeResponseGetter.request(LiveStripeResponseGetter.java:66)
... 136 common frames omitted
Caused by: java.lang.IllegalStateException: null
at com.google.gson.Gson$FutureTypeAdapter.read(Gson.java:1009)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
... 141 common frames omitted
This seems to be due to a race condition in Gson.getAdapter where a FutureTypeAdapter is created by one thread and accessed by another before the delegate is set
changed the title [-]fromJson intermittently fails with IllegalStateException[/-][+]fromJson intermittently fails with IllegalStateException when deserializing recursive structures in parallel[/+]on Dec 2, 2020
Activity
Marcono1234 commentedon Dec 1, 2020
This appears to be the same issue as #625
[-]fromJson intermittently fails with IllegalStateException[/-][+]fromJson intermittently fails with IllegalStateException when deserializing recursive structures in parallel[/+]mwalkerr commentedon Dec 2, 2020
@Marcono1234 I believe you're right, thank you for linking that. Wish I would have found that sooner!
Marcono1234 commentedon Dec 5, 2022
This should be fixed by #1832, which will be available in the next release