minimal-json: com.eclipsesource.json.Json.parse(String strInput) get stuck in Infinite Loop
Hi, I have observed a behavior that com.eclipsesource.json.Json.parse(String strInput) gets stuck in an infinite loop. Usually it happens at app-server (wildfly-10.1.0.Final) startup hence it blocks my web-service. Once it is stuck it would keep getting stuck on further web-services calls unless i reboot my app-server. Sometimes rebooting the app-server doesn’t resolve this and re-trying a few times resolve this issue. Kindly help me with the issue. I would add details once i get concrete steps to reproduce it. I have witnessed this issue more than 30 times since i started using this jar (almost a month back).
Maven dependency which i am using:
<dependency>
<groupId>com.eclipsesource.minimal-json</groupId>
<artifactId>minimal-json</artifactId>
<version>0.9.4</version>
</dependency>
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (9 by maintainers)
Commits related to this issue
- Remove deprecated API As reported in #77, the reference from the static fields in `JsonValue` to static fields in `Json` can lead to deadlocks during class initialization. Since this API has only be... — committed to ralfstx/minimal-json by ralfstx 7 years ago
- Remove deprecated API As reported in #77, the reference from the static fields in `JsonValue` to static fields in `Json` can lead to deadlocks during class initialization. Since this API has only be... — committed to ralfstx/minimal-json by ralfstx 7 years ago
- Remove deprecated API As reported in #77, the reference from the static fields in `JsonValue` to static fields in `Json` can lead to deadlocks during class initialization. Since this API has only be... — committed to ralfstx/minimal-json by ralfstx 7 years ago
- Remove deprecated API As reported in #77, the reference from the static fields in `JsonValue` to static fields in `Json` can lead to deadlocks during class initialization. Since this API has only be... — committed to ralfstx/minimal-json by ralfstx 7 years ago
@sbernard31 Thanks for the thread dump, that’s helpful. As far as I can see, the minimal-json classes
Json
andJsonValue
are loaded concurrently by two different threads, both of which holding a lock (<clinit>
is the static initialization of a class and its static fields).pool-1-thread-10
atcom.eclipsesource.json.Json.<clinit>
(Json.java:63)pool-1-thread-9
atcom.eclipsesource.json.JsonValue.<clinit>
(JsonValue.java:71)Since the initialization of
JsonValue.TRUE
depends on the initialization ofJson.TRUE
, this seems to lead to some kind of deadlock situation.If this is true, the static fields in
JsonValue
, which are only meant for compatibility are causing trouble and should be removed. Since this is a breaking change, it would require a 1.0.0.