Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3740

Scalability issue with PageAccessSynchronizer

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC4
    • Fix Version/s: 1.5-RC5
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      JMeter, Tomcat

      Description

      Class org.apache.wicket.page.PageAccessSynchronizer uses a global lock (org.apache.wicket.page.PageAccessSynchronizer.semaphore) that is needed e.g. when a new instance of a Page is created or when an instance of a page is retrieved, The lock is global and becomes quickly contented. When testing with two parallel threads, about 20% of all statistical stack samples waited for the lock, with four parallel threads about 50%.

      The stack waiting for the lock is

      at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.getPage(PageAccessSynchronizer.java:187)

      called either by

      at org.apache.wicket.Page.dirty(Page.java:327)

      as part of the Page ctor, or by

      at org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)

      when retrieving page.

      Some threads' stacks:

      waiting on (a java.lang.Object@0xHEXADDR)
      at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.getPage(PageAccessSynchronizer.java:187)
      at org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)
      at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:246)
      at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:159)
      at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getPage(ListenerInterfaceRequestHandler.java:89)
      at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:141)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:718)
      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
      ....
      at java.lang.Object.wait(Native Method)

      waiting on (a java.lang.Object@0xHEXADDR) at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.touchPage(PageAccessSynchronizer.java:194)
      at org.apache.wicket.Page.dirty(Page.java:327)
      at org.apache.wicket.Page.init(Page.java:770)
      at org.apache.wicket.Page.<init>(Page.java:223)
      at org.apache.wicket.Page.<init>(Page.java:202)
      at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:99)
      at x.y.z.page.base.Page.<init>(Page.java:100)
      at x.y.z.page.base.ControllerBasedPage.<init>(ControllerBasedPage.java:41)
      ....
      at java.lang.Object.wait(Native Method)

      waiting on (a java.lang.Object@0xHEXADDR) at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.touchPage(PageAccessSynchronizer.java:194)
      at org.apache.wicket.Page.dirty(Page.java:327)
      at org.apache.wicket.Page.init(Page.java:770)
      at org.apache.wicket.Page.<init>(Page.java:223)
      at org.apache.wicket.Page.<init>(Page.java:202)
      at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:99)
      at x.y.z.page.base.Page.<init>(Page.java:100)
      at x.y.z.page.base.ControllerBasedPage.<init>(ControllerBasedPage.java:41)
      at x.y.z.page.NavigationAndContent.<init>(NavigationAndContent.java:43)
      at x.y.z.page.MailDetail.<init>(MailDetail.java:84)
      x.y.z.page.login.Login.<init>-wicket.Page.<init>-wicket.page.PageAccessSynchronizer.lockPage-WAIT_FOR_LOCK

      at java.lang.Object.wait(Native Method)

      waiting on (a java.lang.Object@0xHEXADDR) at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.touchPage(PageAccessSynchronizer.java:194)
      at org.apache.wicket.Page.dirty(Page.java:327)
      at org.apache.wicket.Page.init(Page.java:770)
      at org.apache.wicket.Page.<init>(Page.java:223)
      at org.apache.wicket.Page.<init>(Page.java:202)
      at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:99)
      at x.y.z.page.base.Page.<init>(Page.java:100)
      at x.y.z.page.login.Login.<init>(Login.java:23)
      .....
      at java.lang.Object.wait(Native Method)

      waiting on (a java.lang.Object@0xHEXADDR) at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.touchPage(PageAccessSynchronizer.java:194)
      at org.apache.wicket.Page.dirty(Page.java:327)
      at org.apache.wicket.Page.init(Page.java:770)
      at org.apache.wicket.Page.<init>(Page.java:223)
      at org.apache.wicket.Page.<init>(Page.java:202)
      ....
      at java.lang.Object.wait(Native Method)

      at org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:119)
      at org.apache.wicket.page.PageAccessSynchronizer$1.touchPage(PageAccessSynchronizer.java:194)
      at org.apache.wicket.Page.dirty(Page.java:327)
      at org.apache.wicket.Page.init(Page.java:770)
      at org.apache.wicket.Page.<init>(Page.java:223)
      at org.apache.wicket.Page.<init>(Page.java:202)
      .....

        Attachments

        1. WICKET-3740.patch
          9 kB
          Martin Grigorov
        2. WICKET-3740.patch
          9 kB
          Martin Grigorov
        3. WICKET-3740.patch
          9 kB
          Martin Grigorov
        4. WICKET-3740.patch
          2 kB
          Martin Grigorov

          Activity

            People

            • Assignee:
              ivaynberg Igor Vaynberg
              Reporter:
              mgrigorov Martin Grigorov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: