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

GraalVM, skip interpreter mode warning #4553

Closed
4 tasks done
yanavasileva opened this issue Aug 21, 2024 · 2 comments
Closed
4 tasks done

GraalVM, skip interpreter mode warning #4553

yanavasileva opened this issue Aug 21, 2024 · 2 comments
Assignees
Labels
type:task Issues that are a change to the project that is neither a feature nor a bug fix. version:7.19.15 version:7.20.8 version:7.21.4 version:7.22.0-alpha5 version:7.22.0

Comments

@yanavasileva
Copy link
Member

yanavasileva commented Aug 21, 2024

The following output is printed on start of Tomcat/WildFly pre-packaged distros after we bumped graalvm-sdk version in #4299.
The error is produce on each execution of a script.

Details
20:47:11,532 ERROR [stderr] (MSC service thread 1-6) [To redirect Truffle log output to a file use one of the following options:
20:47:11,533 ERROR [stderr] (MSC service thread 1-6) * '--log.file=<path>' if the option is passed using a guest language launcher.
20:47:11,535 ERROR [stderr] (MSC service thread 1-6) * '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
20:47:11,564 ERROR [stderr] (MSC service thread 1-6) * Configure logging using the polyglot embedding API.]
20:47:11,566 ERROR [stderr] (MSC service thread 1-6) [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
20:47:11,566 ERROR [stderr] (MSC service thread 1-6) The guest application code will therefore be executed in interpreted mode only.
20:47:11,569 ERROR [stderr] (MSC service thread 1-6) Execution only in interpreted mode will strongly impact the guest application performance.
20:47:11,570 ERROR [stderr] (MSC service thread 1-6) For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
20:47:11,570 ERROR [stderr] (MSC service thread 1-6) To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
20:47:11,990 ERROR [stderr] (MSC service thread 1-6) [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
20:47:11,991 ERROR [stderr] (MSC service thread 1-6) The guest application code will therefore be executed in interpreted mode only.
20:47:11,993 ERROR [stderr] (MSC service thread 1-6) Execution only in interpreted mode will strongly impact the guest application performance.
20:47:11,996 ERROR [stderr] (MSC service thread 1-6) For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
20:47:11,997 ERROR [stderr] (MSC service thread 1-6) To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
20:47:12,135 ERROR [stderr] (MSC service thread 1-6) [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
20:47:12,135 ERROR [stderr] (MSC service thread 1-6) The guest application code will therefore be executed in interpreted mode only.
20:47:12,137 ERROR [stderr] (MSC service thread 1-6) Execution only in interpreted mode will strongly impact the guest application performance.
20:47:12,140 ERROR [stderr] (MSC service thread 1-6) For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
20:47:12,141 ERROR [stderr] (MSC service thread 1-6) To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
20:47:12,147 ERROR [stderr] (MSC service thread 1-6) [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
20:47:12,148 ERROR [stderr] (MSC service thread 1-6) The guest application code will therefore be executed in interpreted mode only.
20:47:12,149 ERROR [stderr] (MSC service thread 1-6) Execution only in interpreted mode will strongly impact the guest application performance.
20:47:12,152 ERROR [stderr] (MSC service thread 1-6) For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
20:47:12,153 ERROR [stderr] (MSC service thread 1-6) To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
20:47:12,232 ERROR [stderr] (MSC service thread 1-6) [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
20:47:12,232 ERROR [stderr] (MSC service thread 1-6) The guest application code will therefore be executed in interpreted mode only.
20:47:12,234 ERROR [stderr] (MSC service thread 1-6) Execution only in interpreted mode will strongly impact the guest application performance.
20:47:12,237 ERROR [stderr] (MSC service thread 1-6) For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
20:47:12,238 ERROR [stderr] (MSC service thread 1-6) To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
20:47:12,243 ERROR [stderr] (MSC service thread 1-6) [engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
20:47:12,245 ERROR [stderr] (MSC service thread 1-6) The guest application code will therefore be executed in interpreted mode only.
20:47:12,250 ERROR [stderr] (MSC service thread 1-6) Execution only in interpreted mode will strongly impact the guest application performance.
20:47:12,251 ERROR [stderr] (MSC service thread 1-6) For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
20:47:12,251 ERROR [stderr] (MSC service thread 1-6) To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.

Acceptance Criteria (Required on creation)`

  • Revert graalvm-sdk update.
  • system out logs are not shown in pre-packaged distros

Hints

  • When -Dpolyglot.engine.WarnInterpreterOnly=false is passed to the script engine, the warnings are not displayed.
  • passing the following args, the warnings are not displayed:
    --upgrade-module-path=lib\compiler-21.3.11.jar;ib\compiler-management-21.3.11.jar
    But that means we need to adding two more dependencies, as we haven't used those two libraries so far.

Links

Breakdown

Pull Requests

  1. bot:java-dependency-check ci:all-as ci:webapp-integration
    yanavasileva

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
@yanavasileva yanavasileva added the type:task Issues that are a change to the project that is neither a feature nor a bug fix. label Aug 21, 2024
@yanavasileva yanavasileva mentioned this issue Aug 22, 2024
1 task
@yanavasileva yanavasileva self-assigned this Aug 26, 2024
@yanavasileva yanavasileva changed the title stderr logs after graalvm-sdk update GraalVM, skip interpreter mode warning Aug 26, 2024
@yanavasileva
Copy link
Member Author

yanavasileva commented Aug 27, 2024

Findings:

  • I didn't manage to apply the skip warning flag in
    protected void configureGraalJsScriptEngine(ScriptEngine scriptEngine) {
    ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();
    if (config != null) {
    if (config.isConfigureScriptEngineHostAccess()) {
    // make sure Graal JS can provide access to the host and can lookup classes
    scriptEngine.getContext().setAttribute("polyglot.js.allowHostAccess", true, ScriptContext.ENGINE_SCOPE);
    scriptEngine.getContext().setAttribute("polyglot.js.allowHostClassLookup", true, ScriptContext.ENGINE_SCOPE);
    }
    if (config.isEnableScriptEngineLoadExternalResources()) {
    // make sure Graal JS can load external scripts
    scriptEngine.getContext().setAttribute("polyglot.js.allowIO", true, ScriptContext.ENGINE_SCOPE);
    }
    if (config.isEnableScriptEngineNashornCompatibility()) {
    // enable Nashorn compatibility mode
    scriptEngine.getContext().setAttribute("polyglot.js.nashorn-compat", true, ScriptContext.ENGINE_SCOPE);
    }
    }
    }
    • errors: failed to set graal-js option "polyglot.js.allowHostAccess": js context is already initialized
  • The flag can be add to the jvm args on start but that means we need to add it for all environments.
  • An alternative might be to add the GraalVM compiler for better performance. That will require new dependencies.

Decision: we revert the update and do more detailed investigation on how to handle the warnings for the next set of patches.

@yanavasileva
Copy link
Member Author

After downport, the warnings are gone. On CI they can be observed in webapp-IT stages.

hauptmedia added a commit to hauptmedia/operaton that referenced this issue Nov 4, 2024
…latform#4553

Backported commit 3ed0a47f11 from the camunda-bpm-platform repository.
Original author: yanavasileva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:task Issues that are a change to the project that is neither a feature nor a bug fix. version:7.19.15 version:7.20.8 version:7.21.4 version:7.22.0-alpha5 version:7.22.0
Projects
None yet
Development

No branches or pull requests

2 participants