Bug 1367651

Summary: [GSS](6.4.z) HTTP sessions are not passivated to files only on the coordinator
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Osamu Nagano <onagano>
Component: ClusteringAssignee: jboss-set
Status: CLOSED EOL QA Contact: Michal Vinkler <mvinkler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.9CC: bmaxwell, dereed, fgavrilo, myoshida, paul.ferraro, tmiyargi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-19 12:43:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1496501    
Attachments:
Description Flags
httpsession_sample.war none

Description Osamu Nagano 2016-08-17 06:23:36 UTC
Created attachment 1191470 [details]
httpsession_sample.war

Description of problem:
A web application has the following configuration in its jboss-web.xml.

   <max-active-sessions>2</max-active-sessions>
   <passivation-config>
      <use-session-passivation>true</use-session-passivation>
      <passivation-min-idle-time>1</passivation-min-idle-time>
      <passivation-max-idle-time>-1</passivation-max-idle-time>
   </passivation-config>

Then a session will be passivated very soon in a file in ${jboss.server.data.dir}/infinispan/web/default-host/<WEBAPP>/ except the coordinator. But when you shutdown the coordinator, sessions will have been passivated at that time.


How reproducible:
Always.


Steps to Reproduce:
1. Deploy attached httpsession_sample.war to a cluster.
2. Create some sessions.
curl -v "http://localhost:8380/httpsession_sample/index.jsp"
3. Watch the file store directories.
ls $JBOSS_HOME/domain/servers/*/data/infinispan/web/default-host/httpsession_sample/


Actual results:
Files are created in the directory except the coordinator.


Expected results:
Files are created for all nodes including the coordinator because the cache is a replication cache.

Comment 12 Paul Ferraro 2017-10-04 14:03:49 UTC
The exception in comment #9 should be resolved by https://github.com/jbossas/jboss-eap/pull/2840.  Failure to acquire a lock during passivation is not unexpected - it means that a request is currently using the session, which is why the FAIL_SILENTLY flag should be used.  Additionally, the CACHE_MODE_LOCAL flag should also be used when acquiring the lock on the session during passivation to ensure that multiple nodes can concurrently passivate the same session.

The reproducer configuration in the description is not ideal, since this means that the passivation task might try to passivate a session before the current request completes.  I suggest using a longer passivation-min-idle time when attempting to reproduce the issue.

Additionally, the customer may still have memory issues even after this passivation fix is committed, since a design flaw in EAP6 permits a session to be referenced in the distributed cache, but not in the session manager.  This is the case when a session replicates to other nodes where it has not be explicitly referenced by any request.  Enabling eviction in the Infinispan cache configuration is the only real workaround for this.