-
Bug
-
Resolution: Done
-
Critical
-
23.0.0.Beta1, 23.0.0.Final
-
None
When the distributed session manager is configured with a local, passivating cache; HttpSessionActivationListener events are triggered from an asynchronous @CacheEntryPassivated event. Unfortunately, since this event is asynchronous, the series of cache lookups that it performs can undo the series of cache evictions happening concurrently. This can result in cache entries being retained in memory that should otherwise have been passivated.
To fix this, we need to replace the approach used to reconstruct the session for use by the HttpSessionActivationListener.prePassivate(...) events such that is does not require a cache lookup. Eviction of the entries associated with a given session is already achieved via cascading eviction events.
e.g.
creation meta data entry eviction event -> access meta data evict -> access meta data eviction event -> session attributes evict, etc.
We can preserve the event context across events by use of a concurrent map that is shared between session component factories. Event context will be placed in the map on pre-event and removed on post-event. We can then move the activation notification from the session manager itself to the last event listener in the chain of eviction event cascades. This event listener can reconstruct the session from the contexts that were persisted along the way.
- is cloned by
-
JBEAP-21305 Cache entries in heap can exceed max-active-sessions when distributed session manager configured with local, passivating caches
- Closed