-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
com.eclipsesource.json.Json.parse(String strInput) get stuck in Infinite Loop #77
Comments
Can you please push 0.9.5 to maven repo? |
@mharisce care to give a minimal reproducible example? I don't see where the issue could be. |
Pushing the latest to maven would be nice |
Please push the latest to maven |
We absolutely need a piece of example code to reproduce. A thread dump would also help. Yes, we can release 0.9.5 if it fixes this issue. Do you have an indication that this problem does not occur with master? |
I face a problem which looks like this. This happened almost all the time in our hudson instance. maven output
I almost sure this happened since we migrate to minimal-json (I launched tests before and after several time and I never succeed to get stuck it before the migration) I get a thread dump when tests are stucked
Most of the thread are blocked in JSON.parse() or a minimal-json class "clinit". Any idea of what could happened ? I looked at this deeply and can find a good explanation for now ... |
I test it with 0.9.5-SNAPSHOT (building it locally) and I was not able to reproduce it. |
To be honest, I looked at the code since 0.9.4 version and I didn't see what could fix this issue ... |
@sbernard31 Thanks for the thread dump, that's helpful. As far as I can see, the minimal-json classes
Since the initialization of If this is true, the static fields in |
Sounds like a good fix to prevent a deadlock. SemVer rule 4:
|
It sounds to be a well known JVM behavior : https://www.farside.org.uk/201510/deadlocks_in_java_class_initialisation. I agree about versioning : API break are allowed with major of Is it possible to have a SNAPSHOT version with this fix in a maven repository soon ? (like sonatype) Thx |
Is there any reason not to copy the constructor calls from Json to JsonValue? This would lead to some code duplication but it would not break anything as far as I can see it. |
@arcticicestudio Good point! Thanks. @sbernard31 I think our case here is a bit more tricky no instance of @mafagafogigante Yeah, I thought about that too. But since it's a long time since 0.9.4, it seems like a good time to get rid of the compatibility code, isn't it? |
@mafagafogigante : that's already the case in master since PR #60. And the only "con" I see is that we will have 2 instances of each constant (null, false, true) in memory. (not a big deal...) This could explain why I can not reproduce it locally with a 0.9.5-SNAPSHOT. I would like to test it on the leshan hudson instance but there is not maven repository where I can get this snapshot. This could be a better test as the build fails most of the time on this hudson instance. |
@ralfstx I don't know. This is a JSON parser. I don't see JSON ever changing, so there should be almost no need for the parser to change. However, I agree that keeping all that deprecated stuff isn't good and the impact of simply removing it altogether should be fairly small. @sbernard31 You are right. I didn't notice that. |
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 been added for compatibility, the easiest fix seems to be to remove the deprecated fields in `JsonValue`. Use this opportunity to remove all deprecated API for 0.9.5. This commit should fix #77.
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 been added for compatibility, the easiest fix seems to be to remove the deprecated fields in `JsonValue`. Use this opportunity to remove all deprecated API for 0.9.5. This commit should fix #77.
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 been added for compatibility, the easiest fix seems to be to remove the deprecated fields in `JsonValue`. Use this opportunity to remove all deprecated API for 0.9.5. This commit should fix #77.
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 been added for compatibility, the easiest fix seems to be to remove the deprecated fields in `JsonValue`. Use this opportunity to remove all deprecated API for 0.9.5. This commit should fix #77.
Considering the amount of breakage even in our own code (still using deprecated API in the performancetest project), I suppose that removing all deprecated API in 0.9.5 would likely break too many projects out there. So I'd favor @mafagafogigante's proposal to copy the constructor calls for now. Interestingly, it turns out this change has already been made back in d62f55e. So it seems all that's left to do is releasing 0.9.5. |
I have released 0.9.5. Since d62f55e is not included in 0.9.4, I'm confident that this issue will be fixed in 0.9.5. |
I try with the v0.9.5 and the hudson build is ok now. |
The v0.9.5 behaves better but I still face faces deadlock when I'm building my project. I get a thread dump when tests are stucked
But this times this could be more difficult to fix as this is clearly no easy to reproduce... |
@sbernard31 I'd prefer to open a new bug. Thanks! |
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:
The text was updated successfully, but these errors were encountered: