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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.5
    • 1.7.6, 1.8-beta-3
    • Groovlet / GSP
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: