Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCU-2908

4Known issues: Concurrency issues in JS Models

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Neutral
    • None
    • None
    • None
    • None

    Description

      From Scot

      Hey everyone. I had a call with DHL concerning the JS Models 2. They ran into concurrency issues using it, where the render cycle will unreliably fail but still result in 200 responses. Sadly, this has only come up in their staging systems. The issue comes from the fact that when the GraalVM Context is accessed concurrently, it will sometimes try to access that context from a different thread, which is an illegal access. Would be good to take a look at some solutions to make sure this doesn't happen. Fortunately, it's not a blocker for them as they are just using Freemarker scripts while they wait for a more stable JS Models module.
      The fine folks at GraalVM have addressed this sort of issue with some test examples: https://www.graalvm.org/latest/reference-manual/js/Multithreading/
      I also, while trying to reproduce this, played with upgrading the GraalVM dependencies to the latest 23.0.2. It seems to work, but I did have to modify the jdk11 profile a little:
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.22.1</version>
      <configuration>
      <argLine>-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --module-path=${compiler.dir} --upgrade-module-path=${compiler.dir}/compiler.jar --add-exports=jdk.internal.vm.compiler/org.graalvm.compiler.options=ALL-UNNAMED</argLine>
      </configuration>
      </plugin>
      (added --add-exports=jdk.internal.vm.compiler/org.graalvm.compiler.options=ALL-UNNAMED). If you are interested in having a discussion about this, let me know.
       
      ------------------
       
      Adding to 6.2 known issues page:
       
      Concurrency issues in JS ModelsThe render cycle unreliably fails but still results in 200 responses. This issue comes from the fact that when the GraalVM Context is accessed concurrently, it will sometimes try to access that context from a different thread, which is an illegal access.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              mdrapela Martin Drápela
              mdrapela Martin Drápela
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoR