Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-566

EmptyStackException when rendering macros simultaneously

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6
    • 1.6
    • Engine
    • None

    Description

      When two threads are running VelocimacroFactory.startRenderingMacro() simultaneously (same template), both check that templateMap is empty, then both create a new stack, then the second thread put it in templateMap, replacing the one added by the first thread.

      At this time we got a stack which size == 1 instead of 2.

      Then both threads endProcessingMacros(), both get stack from templateMap and check that its size is > 0, first one empty stack then second pop() macro and gets an EmptyStackException.

      behavior was introduced by improvement VELOCITY-297.

      patch is joined, synchronize(templateMap) in VelocimacroFactory.startRenderingMacro().

      Attachments

        Activity

          People

            Unassigned Unassigned
            emassip Etienne Massip
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: