Tapestry
  1. Tapestry
  2. TAPESTRY-1234

ResourceMatcherImpl not thread safe on multi-CPU system

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.2
    • Component/s: Framework, tapestry-core
    • Labels:
      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.

        Activity

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Greg Woolsey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development