Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2477

Time spent in org.mvel2.integration.impl.ClassImportResolverFactory constructor causing transaction timeouts

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Critical
    • None
    • 5.0.0.FINAL
    • drools-core
    • None

    Description

      We have hit a critical bottleneck in our application as a result of attempting to execute rules on more facts then we have in the past.

      I didn't think it was Drools at first but after profiling it is pretty evident that it is.

      The callgraph is showing 560s in org.mvel2.integration.impl.ClassImportResolverFactory constructor and 152530 calls.
      This also translates into org.mvel2.integration.impl.SimpleValueResolver constructor 18,454,778 calls for my present case.
      This is being invoked from the following in CompiledExpression:

      public Object getValue(Object staticContext, VariableResolverFactory factory) {
      if (!optimized) setupOptimizers();
      if (importInjectionRequired)

      { return execute(false, this, staticContext, new ClassImportResolverFactory(parserContext.getParserConfiguration(), factory)); }

      Where importInjectionRequired is almost always going to be true because of:

      public void setParserContext(ParserContext parserContext) {
      if ((this.parserContext = parserContext) != null)

      { this.importInjectionRequired = parserContext.getImports() != null && parserContext.getImports().size() != 0; }

      }

      The parsercontext.imports seems to be always greater then 0 and to make matters worse I'm seeing a new Factory not only being created per rule but for the same rule multiple times.

      Attachments

        Issue Links

          Activity

            People

              etirelli@redhat.com Edson Tirelli
              samdoyle_jira Samuel Doyle (Inactive)
              Archiver:
              rhn-support-ceverson Clark Everson

              Dates

                Created:
                Updated:
                Resolved:
                Archived:

                PagerDuty