ICEfaces
  1. ICEfaces
  2. ICE-6989

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_P04
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      WebSphere

      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.

        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000GxDiV]
        Deryk Sinotte made changes -
        Assignee Priority P1
        Assignee Mircea Toma [ mircea.toma ]
        Priority Major [ 3 ] Critical [ 2 ]
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s EE-1.8.2.GA_P04 [ 10280 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: