ICEfaces
  1. ICEfaces
  2. ICE-9804

CLONE - Deadlock on Session invalidation/logout on WebSphere

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: EE-1.8.2.GA_P03
    • Fix Version/s: EE-1.8.2.GA_P08
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      WebSphere
    • Assignee Priority:
      P1
    • Salesforce Case Reference:

      Description

      When our SessionDispatcher.Listener runs, it checks to see if it should shut the session down. This is done in a thread that runs every 10 seconds and when it checks, it synchonizes on the SessionMonitors while it does so:

           try {
               synchronized (SessionMonitors) {
                   // Iterate over the session monitors using a copying iterator
                   Iterator iterator = new
      ArrayList(SessionMonitors.values()).iterator();
                   while (iterator.hasNext()) {
                       final Monitor sessionMonitor = (Monitor) iterator.next();
                       sessionMonitor.shutdownIfExpired();
                       
      ThreadLocalUtility.checkThreadLocals(ThreadLocalUtility.EXITING_SESSION_MONITOR);
                   }
               }

               Thread.sleep(10000);
           } catch (InterruptedException e) {
               //ignore interrupts
           }

      During the check to see if it should invalidate the session, it checks for a session attribute which, in WebSphere, appears to be a synchronized HashMap:

           Object o = session.getAttribute(POSITIVE_SESSION_TIMEOUT);

      The other thread is a request to logout which invalidates the current session and then sends out a SessionDestroyed event which we listen for. This, presumably, locks down that same HashMap that holds the session attributes *before* it sends the SessionDestroyed event. So while our own internal thread has grabbed the lock on the SessionMonitors the logout thread grabbed the lock on the session attribute map. Our SessionMonitor cannot continue to shutdown without getting the session attribute and the logout thread cannot continue with the SessionDestroyed call because the SessionMonitors lock is taken.
      1. ICE-9804.patch
        2 kB
        Mircea Toma

        Activity

        Carsten Bansemir created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case Reference 5007000000Y4X8RAAV
        Ken Fyten made changes -
        Fix Version/s EE-1.8.2.GA_P08 [ 11178 ]
        Fix Version/s EE-1.8.2.GA_P04 [ 10280 ]
        Ken Fyten made changes -
        Assignee Priority P1 [ 10010 ]
        Mircea Toma made changes -
        Attachment ICE-9804.patch [ 16685 ]
        Attachment icefaces.jar [ 16686 ]
        Ken Fyten made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Carsten Bansemir
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: