Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4492

Bug in groovy.util.GroovyScriptEngine isSourceNewer() results in gratuitous recompilations and lost of static state in groovlets

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.5
    • Fix Version/s: 1.7.6, 1.8-beta-3
    • Component/s: Groovlet / GSP
    • Labels:
      None
    • Environment:
      Bug is independent of OS and JVM. I'm running Ubuntu 10.10 with OpenJDK 1.6.0_18.

      Description

      isSourceNewer() method in groovy.util.GroovyScriptEngine does evaluate script sources for recompilation (it will return true) in cases where 'nextPossibleRecompilationTime >= lastMod'. This is wrong and results in gratuitous recompilations of scripts.

      An ugly side effect of this bug is, that groovlet state (static objects kept in a static class) is being lost between incoming requests, due to gratuitous recompilation and subsequent restart of groovlets.

      The attached patch fixes the issue.

        Attachments

        1. patchfile.txt
          0.5 kB
          Timur Tleukenov
        2. patchfile2.txt
          0.6 kB
          Timur Tleukenov
        3. patchfile3.txt
          0.6 kB
          Timur Tleukenov
        4. patchfile-all3.txt
          0.9 kB
          Timur Tleukenov

          Activity

            People

            • Assignee:
              guillaume Guillaume Sauthier
              Reporter:
              timur Timur Tleukenov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: