Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-2593

Fix Infinite loop in the MVEL validation system

    XMLWordPrintable

    Details

      Description

      It looks like we have an infinite loop on the MVEL validation of Studio Project.

      Issue description

      • the project does not load : `504` error on the client side
      • on the server side I see up to 30 threads doing mvel stuffs

      Extract of JStack gives :

          at org.mvel2.CompileException.showCodeNearError(CompileException.java:188)
          at org.mvel2.CompileException.generateErrorMessage(CompileException.java:219)
          at org.mvel2.CompileException.getMessage(CompileException.java:79)
          at com.nuxeo.studio.core.builders.MVELValidator.validateMVELTemplateOrExpression(MVELValidator.java:96)
          at com.nuxeo.studio.core.builders.OpChainValidation.validateMVELExpression(OpChainValidation.java:290)
          at com.nuxeo.studio.core.builders.OpChainFeatureBuilder.validate(OpChainFeatureBuilder.java:142)
          at com.nuxeo.studio.core.builders.OpChainFeatureBuilder.validate(OpChainFeatureBuilder.java:36)
          at com.nuxeo.studio.core.impl.DefaultProject.validate(DefaultProject.java:617)
          at com.nuxeo.studio.servlet.StudioServiceImpl.getProject(StudioServiceImpl.java:164)
      

      Looking at the source code the problem is the `e.getMessage()`

              catch (CompileException e) {
                  String msg = e.getMessage();
                  if (cache != null) {
                      cache.put(expression, msg);
                  }
      

      MVEL bug was already reported : http://jira.codehaus.org/browse/MVEL-292

      • bug reported in 2013
      • patch provided
      • patch never integrated

      criticity

      • the client hits refresh
        => Nuxeo Studio starts the validation in a new http threads
      • the client hits refresh
        => Nuxeo Studio starts the validation in a new http threads

      ==> Connect server is dead with a load of 28 and we have to restart it.

      I just emailed the client asking him to stop trying to load the project until we fix it !

      fix

      Applied the fix on our version of mvel
      https://github.com/nuxeo/mvel/tree/2.1.9.NX2

      Updated live connect and verified the project now loads !

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: