Tapestry
  1. Tapestry
  2. TAPESTRY-2382

Possible deadlock in ExpressionCacheImpl (on _lock instance)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1.3
    • Fix Version/s: 4.1.6
    • Component/s: Framework
    • Labels:
      None

      Description

      Under some circumstances deadlock occurs in the ExpressionCacheImpl.

      1)Thread Ta opening a Page Pa. Page Pa does not bound to the current request cycle, so new Instance requested from PageSource and current thread enter to the synchronized _pool.borrowObject(key)
      2) At this time thread Tb render page Pb, and for some property evaluates expression binding. So ExpressionCacheImpl's _lock locked by thread Tb. Result of expression evaluation is a reference to the Page Pc instance, which is not bound to the current thread, so new Instance requested from PageSource and current thread tried to enter to the synchronized _pool.borrowObject(key) which is locked by Ta.
      3) Thread Ta worked creating new Page Pa Instance, which is not exists in the pool, so a new Page instance should be created. In the proccess of parsing page loader try to evaluate expression binding and try to lock a ExpressionCacheImpl's _lock, which is locked by thread Tb.
      4) Whe have a deadlock, so no new page instance and expression could be created and evaluated.

      This causes a serios problems while system startup, so we need to restart our app many times, untill it warmed up.

        Issue Links

          Activity

          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12568225 ] jira [ 12590048 ]
          Mark Thomas made changes -
          Workflow jira [ 12429649 ] Default workflow, editable Closed status [ 12568225 ]
          Marcus Schulte made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Marcus Schulte made changes -
          Assignee Marcus Schulte [ mschu ]
          Marcus Schulte made changes -
          Field Original Value New Value
          Link This issue relates to TAPESTRY-2530 [ TAPESTRY-2530 ]
          Alexander Gavrilov created issue -

            People

            • Assignee:
              Marcus Schulte
              Reporter:
              Alexander Gavrilov
            • Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development