ICEfaces
  1. ICEfaces
  2. ICE-8833

Session leak in SessionMonitors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-1.8.2.GA_P05
    • Fix Version/s: EE-1.8.2.GA_P06
    • Component/s: None
    • Labels:
      None
    • Environment:
      icefaces-1.8.2 revision 32630 from trunk, tomcat 6.0.32, jdk 1.6_027
    • Assignee Priority:
      P2

      Description

      SessionDispatcher do not remove invalidated sessions from Map.
      In worst case users notice thousands of unused session objects (some old Jira issues I saw here).
      I attached file SessionDispatcher.java with additional logger messages.

      Test case.
      Prepare app with form-login for basic authentication and logout button.
      If you logon and logout few times 'Session Monitor session count' grows and many 'session already invalidated' messages occurs every 10 seconds..

      The main reason is line:
         iterator = new ArrayList(SessionMonitors.values()).iterator();
      Session cleaner do not clean correct list.
      After change to
         iterator = SessionMonitors.values().iterator();
      everything seems to be ok and sessions are removed.
      1. SessionDispatcher.java
        21 kB
        Krashan Brahmanjara
      2. SessionDispatcher.java
        20 kB
        Krashan Brahmanjara
      3. SessionDispatcher.java
        20 kB
        Krashan Brahmanjara
      4. sessionerrors.txt
        4 kB
        Krashan Brahmanjara
      5. sessionlog.txt
        2 kB
        Krashan Brahmanjara
      6. sessionlog2.txt
        3 kB
        Krashan Brahmanjara
      7. sessionlog3.txt
        3 kB
        Krashan Brahmanjara
      8. web.xml
        11 kB
        Krashan Brahmanjara
      1. sessionproblems.PNG
        85 kB

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33193 Thu Jan 24 06:03:19 MST 2013 mircea.toma ICE-8833 Modified Monitor class to removes itself from the list of runing monitors when invalidating as session that was already expired. Changed getId() to a static method so that it can be used in all the places where the session ID is required.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/SessionDispatcher.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #32924 Thu Dec 27 11:10:19 MST 2012 mircea.toma ICE-8833 Modified InterceptingServletSession to invalidate the session right away instead of waiting for the JSF cycle to complete. Modified MainSessionBoundServlet to dispose the view and its associated FacesContext only after the JSF lifecycle ended to avoid NPEs in JSF or application code. Modified corresponding servers for 'receive-updates' and 'send-receive-updates' requests to capture SessionExpiredException (thown when an expired session is accessed) and respond with the session-expired message. Modified MainServlet to respond with the session expired message when the incoming AJAX requests belong to an invalidated session.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MainSessionBoundServlet.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/SendUpdates.java
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/connection.async.js
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MainServlet.java
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/application.js
        Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/BlockExpiredSessionRequests.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/ReceiveSendUpdates.java
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/src/heartbeat.js
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ProxyHttpSession.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/SessionDispatcher.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/InterceptingServletSession.java

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Krashan Brahmanjara
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: