[ 
https://issues.apache.org/jira/browse/VELTOOLS-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov closed VELTOOLS-157.
-----------------------------------

> Race condition when instantiating tools
> ---------------------------------------
>
>                 Key: VELTOOLS-157
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-157
>             Project: Velocity Tools
>          Issue Type: Bug
>          Components: GenericTools, Misc
>    Affects Versions: 2.0
>         Environment: Linux/Tomcat
>            Reporter: Colin Leroy
>            Assignee: Claude Brisson
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: fix_tool_instantiation_race.patch
>
>
> Hello,
> Since Velocity tools are lazy-loaded when necessary only, there's a (wide) 
> race condition problem during tools instantiation.
> Until the tool has been constructed, configure()'d and init()'d, it is not 
> accessible in the toolbox cache and every invocation of the tool triggers a 
> new Construct(), configure() and init().
> The problem is unavoidable with any tool for which initialization takes a few 
> seconds on a heavy enough traffic - for example my Lucene-based search tool 
> gets typically instantiated two or three times on my production servers, and 
> can get instantiated dozens of time on an artificially generated load (siege 
> for example).
> The following patch fixes that. 
> I hope it's good enough to get incorporated, if not, I'm willing to put more 
> work in it.
> Thanks for your help !



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to