Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-157

Race condition when instantiating tools

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 3.0
    • GenericTools, Misc
    • None
    • Linux/Tomcat

    Description

      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 !

      Attachments

        Activity

          People

            cbrisson Claude Brisson
            colinleroy Colin Leroy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: