Hi all,
We had an issue yesterday in one of our applications that makes heavy use of the lift-json package, version 2.6.2. The application is multi-threaded. One thread that attempted to deserialize JSON data was stuck busy waiting, and all other threads doing any kind of JSON de/serialization were blocked because of that stuck thread.
Relevant excerpt from a thread dump that shows the still running, but not progressing thread:
java.lang.Thread.State: RUNNABLE
at java.util.WeakHashMap.expungeStaleEntries(WeakHashMap.java:408)
- locked <0x00000007e55a8340> (a java.lang.ref.ReferenceQueue)
at java.util.WeakHashMap.getTable(WeakHashMap.java:417)
at java.util.WeakHashMap.get(WeakHashMap.java:464)
at com.thoughtworks.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:72)
at com.thoughtworks.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:68)
at net.liftweb.json.Meta$ParanamerReader$.lookupParameterNames(Meta.scala:89)
at net.liftweb.json.Meta$Reflection$.argsInfo$1(Meta.scala:237)
at net.liftweb.json.Meta$Reflection$.constructorArgs(Meta.scala:257)
Here's an example of one of the threads which were blocking:
java.lang.Thread.State: BLOCKED (on object monitor)
at java.util.WeakHashMap.expungeStaleEntries(WeakHashMap.java:386)
- waiting to lock <0x00000007e55a8340> (a java.lang.ref.ReferenceQueue)
at java.util.WeakHashMap.getTable(WeakHashMap.java:417)
at java.util.WeakHashMap.get(WeakHashMap.java:464)
at com.thoughtworks.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:72)
at com.thoughtworks.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:68)
at net.liftweb.json.Meta$ParanamerReader$.lookupParameterNames(Meta.scala:89)
at net.liftweb.json.Meta$Reflection$.argsInfo$1(Meta.scala:237)
at net.liftweb.json.Meta$Reflection$.constructorArgs(Meta.scala:253)
As you see, it's not really a fault of lift-json but rather a problem with the Paranamer library. Looks like a known issue(
https://github.com/paul-hammant/paranamer/issues/8) and purportedly solved in Paranamer 2.6.1
Would it be possible to update lift-json to use a more recent Paranamer library with a version > 2.6.1?
Else we'd have to consider excluding this transitive dependency and supply it separately in our build.
I can provide more details if required.
Thanks and best regards
Benno