Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-4275

Initial passivation of sessions during startup not based on full set of sessions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • EAP_EWP 5.1.0
    • EAP 5.0.0, EWP 5.0.0, EAP 5.0.1
    • Clustering, System
    • None

      I expect this is the cause of JBPAPP-2452.

      JBossCacheManager.initializeUnloadedSessions() creates a map of sessions stored in the cache, key = session id, value = some metadata about the session. As it does this, it, passivates sessions if:

      1) the last access time for the session > passivationMaxIdleTime_

      2) OR, # of sessions > maxActiveAllowed_ && last access time for the session > passivationMaxIdleTime_

      Problem is 2) can only work correctly if # of session is the full count of sessions, not just the count so far through the loop. Otherwise you can have more sessions than you want, but the loop doesn't get to the point where it recognizes that until after sessions whose last access time for the session > passivationMaxIdleTime_ have been processed. Those sessions won't get passivated, and will end up remaining in memory.

      Effect: after the webapp is started, more sessions are in memory than intended, until the first run of the background processing thread at which point they will be passivated.

      Fix is to store all sessions in the unloadedSessions_ map, and then do a second loop for the passivation part.

      I expect some difference with the IBM JDK is resulting in a different iteration order, which is why these tests are only failing with IBM.

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: