Tapestry 5
  1. Tapestry 5
  2. TAP5-1355

Threading issue with SessionStateObjects

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.4
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      When a page request consists of multiple HTTP request (e.g. page and some dynamically generated images) and all those requests access a SessionStateObject, it happens that a new session (with an empty SSO) is created for some of the request threads.

      I was able to create a very simple example to recreate that problem:

      -A simple page that displays 20 dynamically generated images in a loop.
      -In the page, a SSO, holding a number value is initialized to a random number.
      -Each of the dynamic images read that number and draws it.
      -Make sure that a HTTP-Request is made for every image on the page (by adding some random number to the event link)

      The effect that you'll see after some reloads of the page (maybe you need to reload 30 times) is that some images will draw 0 as SSO value instead of the number set in the page @BeginRender method. Those fields will be marked in red in the demo so you can quickly see them.

      I definitely beleive that tapestry should take care of this. It is a use case for SSOs that is probably too common to ignore.

      Why can't this be automatically integrated into the ApplicationStateManager?

      The demo has been deployed here

      http://www.avetana.de/taptest/

      1. taptest.tgz
        4 kB
        Moritz Gmelin
      2. Screenshot.png.jpg
        48 kB
        Moritz Gmelin

        Issue Links

          Activity

          Moritz Gmelin created issue -
          Moritz Gmelin made changes -
          Field Original Value New Value
          Attachment taptest.tgz [ 12460346 ]
          Moritz Gmelin made changes -
          Description When a page request consists of multiple HTTP request (e.g. page and some dynamically generated images) and all those requests access a SessionStateObject, it happens that a new session (with an empty SSO) is created for some of the request threads.

          I was able to create a very simple example to recreate that problem:

          -A simple page that displays 20 dynamically generated images in a loop.
          -In the page, a SSO, holding a number value is initialized to a random number.
          -Each of the dynamic images read that number and draws it.
          -Make sure that a HTTP-Request is made for every image on the page (by adding some random number to the event link)

          The effect that you'll see after some reloads of the page (maybe you need to reload 30 times) is that some images will draw 0 as SSO value instead of the number set in the page @BeginRender method. Those fields will be marked in red in the demo so you can quickly see them.

          I definitely beleive that tapestry should take care of this. It is a use case for SSOs that is probably too common to ignore.

          Why can't this be automatically integrated into the ApplicationStateManager?
           
          When a page request consists of multiple HTTP request (e.g. page and some dynamically generated images) and all those requests access a SessionStateObject, it happens that a new session (with an empty SSO) is created for some of the request threads.

          I was able to create a very simple example to recreate that problem:

          -A simple page that displays 20 dynamically generated images in a loop.
          -In the page, a SSO, holding a number value is initialized to a random number.
          -Each of the dynamic images read that number and draws it.
          -Make sure that a HTTP-Request is made for every image on the page (by adding some random number to the event link)

          The effect that you'll see after some reloads of the page (maybe you need to reload 30 times) is that some images will draw 0 as SSO value instead of the number set in the page @BeginRender method. Those fields will be marked in red in the demo so you can quickly see them.

          I definitely beleive that tapestry should take care of this. It is a use case for SSOs that is probably too common to ignore.

          Why can't this be automatically integrated into the ApplicationStateManager?
           
          The demo has been deployed here

          http://www.avetana.de/taptest/
          Moritz Gmelin made changes -
          Attachment Screenshot.png.jpg [ 12460350 ]
          Josh Canfield made changes -
          Link This issue is broken by TAP5-834 [ TAP5-834 ]
          Josh Canfield made changes -
          Assignee Josh Canfield [ joshcanfield ]
          Josh Canfield made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Josh Canfield made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 5.3.1 [ 12316673 ]
          Resolution Fixed [ 1 ]
          Howard M. Lewis Ship made changes -
          Fix Version/s 5.3 [ 12316024 ]
          Fix Version/s 5.3.1 [ 12316673 ]
          Howard M. Lewis Ship made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Josh Canfield
              Reporter:
              Moritz Gmelin
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development