NanoContainer
  1. NanoContainer
  2. NANO-167

Race Condition in GroovyContainerBuilder.createContainerFromScript().

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Groovy Scripts appear to shared across multiple threads, so modifications of the bindings and therefore execution of the groovy scripts must be synchronized. I suspect that other scripting engines might also suffer the same problem, but I don't have the time to stress-test them.

      Solution: Make createContainerFromScript() synchronized.

        Activity

        Hide
        Michael Rimov added a comment -

        After skype session with Mauro, he has come up with a fix of creating new groovy script instances for each invocation and storing the precompiled class definition in state. For the record, on my machine the execution of a simple script including the new instantiation code is still 0 ms.

        Show
        Michael Rimov added a comment - After skype session with Mauro, he has come up with a fix of creating new groovy script instances for each invocation and storing the precompiled class definition in state. For the record, on my machine the execution of a simple script including the new instantiation code is still 0 ms.
        Michael Rimov made changes -
        Field Original Value New Value
        Fix Version/s 1.0 [ 10148 ]
        Assignee Michael Rimov [ rimovm ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Michael Rimov
            Reporter:
            Michael Rimov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: