[ 
https://issues.apache.org/jira/browse/VELOCITY-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12905321#action_12905321
 ] 

Nathan Bubna commented on VELOCITY-776:
---------------------------------------

I ask because the VelocimacroManager uses the "log tag" parameter given to 
evaluate(...) as the local namespace key.   If i alter your test to iterate the 
"log tag", then the namespace collisions disappear (of course), and your test 
passes.

Granted, i don't yet understand exactly why the VelocimacroManager fails to 
properly handle multi-threaded addition of macros (the same macro, even) to the 
same namespace (i haven't had my nose deep in this code in a while).  Still, 
that appears to be the catching point at the moment.

> "velocimacro.permissions.allow.inline.local.scope" makes VelocityEngine not 
> threadsafe
> --------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-776
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-776
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.4
>         Environment: Sun java jdk1.6.0_21, Ubuntu 10.04
>            Reporter: Simon Kitching
>         Attachments: RenderVelocityTemplate.java, 
> RenderVelocityTemplateTest.java
>
>
> The attached unit test shows that when 
> "velocimacro.permissions.allow.inline.local.scope" is set to true, and 
> multiple threads use the same VelocityEngine instance then macros sometimes 
> don't get expanded and the #macroname call remains in the output text.
> Notes:
> * running test method "testMultipleEvals" (single threaded case) always 
> succeeds
> * running test method "testMultiThreadMultipleEvals" always fails
> * commenting out the allow.inline.local.scope line makes the multithread test 
> pass (but of course has other side-effects)
> Interestingly, for the multithread case it seems that 1 thread always 
> succeeds and N-1 threads fail.

-- 
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