EmptyStackException when rendering macros simultaneously
--------------------------------------------------------

                 Key: VELOCITY-566
                 URL: https://issues.apache.org/jira/browse/VELOCITY-566
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.6
            Reporter: Etienne Massip
             Fix For: 1.6
         Attachments: emptyStackExceptionMacrosVTL.patch

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().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to