Bug 47389 - DeltaManager doesn't do the session replication. (notifySessionListenersOnReplication=false)
DeltaManager doesn't do the session replication. (notifySessionListenersOnRep...
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Cluster
6.0.20
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-06-18 03:39 UTC by Keiichi Fujino
Modified: 2009-07-01 12:07 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2009-06-18 03:39:55 UTC
DeltaManager is used. 
When notifySessionListenersOnReplication is set to false, session replication is not done. 

This cause is in the following DeltaManager#handleSESSION_CREATED's codes. 
protected void handleSESSION_CREATED(SessionMessage msg,Member sender) {
...
    if(notifySessionListenersOnReplication)
        session.setId(msg.getSessionID());
    else
        session.setIdInternal(msg.getSessionID());
    session.resetDeltaRequest();
    session.endAccess();

}

When notifySessionListenersOnReplication is false, only session.setIdInternal is executed.
Session is not added to session map of DeltaManager in session.setIdInternal method.
As a result, session replication is not done. 

When notifySessionListenersOnReplication is false, 
I think that I should add session to session map of DeltaManager. 
For instance, as follows.

[start.]

Index: java/org/apache/catalina/ha/session/DeltaManager.java
===================================================================
--- java/org/apache/catalina/ha/session/DeltaManager.java	(revision 763870)
+++ java/org/apache/catalina/ha/session/DeltaManager.java	(working copy)
@@ -1435,10 +1435,12 @@
         // use container maxInactiveInterval so that session will expire correctly in case of primary transfer
         session.setMaxInactiveInterval(getMaxInactiveInterval());
         session.access();
-        if(notifySessionListenersOnReplication)
+        if(notifySessionListenersOnReplication) {
             session.setId(msg.getSessionID());
-        else
+        } else {
             session.setIdInternal(msg.getSessionID());
+            add(session);
+        }
         session.resetDeltaRequest();
         session.endAccess();
 

[end.]

Best regards.
Comment 1 Filip Hanik 2009-06-18 08:31:02 UTC
Fixed in http://svn.apache.org/viewvc?rev=786124&view=rev
Backport proposed for 6.0
Many thanks for the patch!
Comment 2 Rainer Jung 2009-07-01 12:07:36 UTC
Applied to TC6 as r790313 and to TC5.5 as r790307. Will be part of 6.0.21 and 5.5.28.