Skip to content
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

LESS compilation results in busy loop, thread hangs, with Nashorn engine #59

Open
bradmac opened this issue Oct 15, 2014 · 0 comments
Open

Comments

@bradmac
Copy link

bradmac commented Oct 15, 2014

Compiling bootstrap occasionally results in a thread hung indefinitely in a busy loop. Usually it compiles in a few seconds, but i've been seeing it stuck for several hours at times.

Assuming that the problem is buried deep within either the LESS or Nashorn code a fix might be out of reach. I could detect the stuck thread and interrupt it with application code, but apparently nashorn doesnt check interrupt status. However, this can be done from within the JS. Would it be possible to insert something like this into some suitable processing loop?

if (java.lang.Thread.interrupted()) break;

See commentary about interrupting Nashorn scripts here - http://stackoverflow.com/questions/24855182/interrupt-java-thread-running-nashorn-script

Thread stack is probably not much help, its mostly lamdas:

java.lang.Thread.State: RUNNABLE
at jdk.nashorn.internal.runtime.ScriptRuntime.EQ_STRICT(ScriptRuntime.java:767)
at jdk.nashorn.internal.runtime.ScriptRuntime.NE_STRICT(ScriptRuntime.java:779)
at java.lang.invoke.LambdaForm$DMH/1653016297.invokeStatic_LL_I(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$MH/1620750378.convert(LambdaForm$MH)
at java.lang.invoke.LambdaForm$MH/1064733140.linkToCallSite(LambdaForm$MH)
at jdk.nashorn.internal.scripts.Script$^eval_$2._L15$Parser$getLocation(:310)
... many more...
at java.lang.invoke.LambdaForm$MH/522631210.linkToCallSite(LambdaForm$MH)
at jdk.nashorn.internal.scripts.Script$^eval_._L12(:64)
at java.lang.invoke.LambdaForm$DMH/883214287.invokeStatic_LLLLL_L(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$MH/664550332.invokeExact_MT(LambdaForm$MH)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:504)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:206)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:107)
at com.asual.lesscss.compiler.NashornCompiler.compile(NashornCompiler.java:77)
at com.asual.lesscss.LessEngine.compile(LessEngine.java:107)
at com.asual.lesscss.LessEngine.compile(LessEngine.java:101)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant