You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <de...@velocity.apache.org> on 2018/06/26 02:43:00 UTC

[jira] [Resolved] (VELTOOLS-157) Race condition when instantiating tools

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

Claude Brisson resolved VELTOOLS-157.
-------------------------------------
       Resolution: Fixed
         Assignee: Claude Brisson
    Fix Version/s: 3.0

Fixed in commit 1834392. thanks for the patch.

> 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-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org