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

Version 0.1.30 java.lang.IllegalStateException: Executor thread not set after 100 ms #116

Open
antunius opened this issue Aug 13, 2021 · 1 comment

Comments

@antunius
Copy link

Hi guys,
We use delight-nashorn-sandbox for evaluating js code in Java container application, we recently had a problem with Executor thread not set after 100 ms in any code.
I was able to replicate the problem in debug mode set to threadMonitor to null,
I'm instantiating the NashornSandboxImpl and creating a spring bean to improve performance and to use just insert the context in the ScriptContext, the application went through stress tests and withstood well, but on a usual day and without much use there was this problem.
I managed to work around the problem by resetting the nashorn instance if there is an IllegalStateException.
Thank you for your attention.

@mxro
Copy link
Collaborator

mxro commented Aug 19, 2021

Hey @antunius thank you for raising this issue!

Maybe there could be some issues with concurrent threads being run by the JVM. What have you configured as maxCPUTime (assuming 100ms)? Would it be possible to increase that to lets say 1000 ms and see if the issue persist?

Fyr here the code that causes this exception

and here a unit tests that asserts the behavour around this:

https://github.com/javadelight/delight-nashorn-sandbox/blob/23ba3d7013528d1eafcc5123507b3a3f71ab07d5/src/test/java/delight/nashornsandbox/internal/TestExecutorThreadNotSet.java

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

2 participants