johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <>
Subject Potential deadlock while classloading in JsonValue
Date Tue, 26 Feb 2019 06:57:40 GMT
Hi folks!
We've seen a mysterious deadlock in Johnzon on startup under heavy load.

   java.lang.Thread.State: RUNNABLE
   java.lang.Thread.State: RUNNABLE
        at org.apache.johnzon.core.JsonReaderImpl.parseObject(
   java.lang.Thread.State: RUNNABLE
        at org.apache.johnzon.core.JsonReaderImpl.parseObject(

Those are the locations which are stuck.

All of them seem to hang on a new() for the following: JsonArrayImpl, JsonLongImpl, JsonStringImpl.But
the stack trace does NOT contain the actual call code inside the <init>.So my conclusio
for now is that it fails to load the Class. 
I suspect that the classloading of JsonValue is to blame.

JsonValue contains a few static fields. And those fields do load the WHOLE JsonProvider!So
while doing the init of JsonValue it might well be that another thread tries to load some
other class subsequently needed by JsonValue.<init>.
Of course if this is really the case, then it's a problem in the spec API and probably not
in Johnzon itself.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message