Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1234

ResourceMatcherImpl not thread safe on multi-CPU system

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 4.1.1
    • 4.1.2
    • Framework, tapestry-core
    • None

    Description

      Load testing on a multi-CPU system uncovered another thread safety issue. I'm not sure why, because I'm unclear on the call flow, but the RegexpMatcher instance held by ResourceMatcherImpl can be called by two threads at once. This leads to predictable ArrayIndexOutOfBounds errors down in the ORO Perl5Matcher class, because that class has instance state that is being accessed by both threads, similar to the SimpleDateFormat issue in TAPESTRY-1229.

      I turned it into a ThreadLocal, which worked, but I think that loses some of the pattern caching performance benefits. Not sure what the best solution is, but a ThreadLocal is guaranteed to be safe.

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            gwoolsey Greg Woolsey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: