ICEfaces
  1. ICEfaces
  2. ICE-4770

dispose-views and rendering mutual exclusion

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2-RC1, 1.8.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces

      Description


      A dispose-views request can occur at nearly the same time as a push request or a user event. This can lead to a race condition where the view is disposed while being rendered.

        Activity

        Hide
        Ted Goddard added a comment -

        Tested fix was to add synchronization to view disposal.

        +++ src/com/icesoft/faces/webapp/http/core/DisposeViews.java (working copy)
        @@ -26,7 +26,9 @@
        View view = (View) views.remove(viewIdentifiers[i]);
        // Jira 1616 Logout throws NPE.
        if (view != null)

        { + view.acquireLifecycleLock(); view.dispose(); + view.releaseLifecycleLock(); }

        }

        Show
        Ted Goddard added a comment - Tested fix was to add synchronization to view disposal. +++ src/com/icesoft/faces/webapp/http/core/DisposeViews.java (working copy) @@ -26,7 +26,9 @@ View view = (View) views.remove(viewIdentifiers [i] ); // Jira 1616 Logout throws NPE. if (view != null) { + view.acquireLifecycleLock(); view.dispose(); + view.releaseLifecycleLock(); } }
        Hide
        Ted Goddard added a comment -

        Please review the change (revision 19118) and close or modify. Race condition is reproducible under load.

        The load test may issue a send-receive-updates which is context-switched out when a dispose-views is received and processed. When the send-receive-updates wakes up again, the viewRoot is null.

        Under real-world conditions, a more likely case is a dispose-views coinciding with a push update.

        Show
        Ted Goddard added a comment - Please review the change (revision 19118) and close or modify. Race condition is reproducible under load. The load test may issue a send-receive-updates which is context-switched out when a dispose-views is received and processed. When the send-receive-updates wakes up again, the viewRoot is null. Under real-world conditions, a more likely case is a dispose-views coinciding with a push update.
        Hide
        Mircea Toma added a comment -

        Use try/finally construct to make sure JSF lifecycle lock is always released.

        Show
        Mircea Toma added a comment - Use try/finally construct to make sure JSF lifecycle lock is always released.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: