tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1831410 - in /tomcat/trunk: java/org/apache/catalina/ha/session/DeltaManager.java java/org/apache/catalina/ha/session/LocalStrings.properties webapps/docs/changelog.xml
Date Fri, 11 May 2018 13:08:30 GMT
Author: markt
Date: Fri May 11 13:08:30 2018
New Revision: 1831410

URL: http://svn.apache.org/viewvc?rev=1831410&view=rev
Log:
Remove duplicate calls when creating a replicated session to reduce the time taken to create
the session and thereby reduce the chances of a subsequent session update message being ignored
because the session does not yet exist.

Modified:
    tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
    tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=1831410&r1=1831409&r2=1831410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Fri May 11 13:08:30
2018
@@ -1226,7 +1226,12 @@ public class DeltaManager extends Cluste
         counterReceive_EVT_SESSION_DELTA++;
         byte[] delta = msg.getSession();
         DeltaSession session = (DeltaSession) findSession(msg.getSessionID());
-        if (session != null) {
+        if (session == null) {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("deltaManager.receiveMessage.delta.unknown",
+                        getName(), msg.getSessionID()));
+            }
+        } else {
             if (log.isDebugEnabled()) {
                 log.debug(sm.getString("deltaManager.receiveMessage.delta",
                         getName(), msg.getSessionID()));
@@ -1292,7 +1297,6 @@ public class DeltaManager extends Cluste
                     getName(), msg.getSessionID()));
         }
         DeltaSession session = (DeltaSession) createEmptySession();
-        session.setManager(this);
         session.setValid(true);
         session.setPrimarySession(false);
         session.setCreationTime(msg.getTimestamp());
@@ -1301,7 +1305,6 @@ public class DeltaManager extends Cluste
         session.setMaxInactiveInterval(getContext().getSessionTimeout() * 60, false);
         session.access();
         session.setId(msg.getSessionID(), notifySessionListenersOnReplication);
-        session.resetDeltaRequest();
         session.endAccess();
 
     }

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties?rev=1831410&r1=1831409&r2=1831410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/LocalStrings.properties Fri May 11 13:08:30
2018
@@ -37,6 +37,7 @@ deltaManager.expireSessions=Manager [{0}
 deltaManager.receiveMessage.accessed=Manager [{0}]: received session [{1}] accessed.
 deltaManager.receiveMessage.createNewSession=Manager [{0}]: received session [{1}] created.
 deltaManager.receiveMessage.delta=Manager [{0}]: received session [{1}] delta.
+deltaManager.receiveMessage.delta.unknown=Manager [{0}]: received unknown session [{1}] delta.
 deltaManager.receiveMessage.error=Manager [{0}]: Unable to receive message through TCP channel
 deltaManager.receiveMessage.eventType=Manager [{0}]: Received SessionMessage of type=[{1}]
from [{2}]
 deltaManager.receiveMessage.expired=Manager [{0}]: received session [{1}] expired.

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1831410&r1=1831409&r2=1831410&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri May 11 13:08:30 2018
@@ -110,6 +110,16 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Cluster">
+    <changelog>
+      <fix>
+        Remove duplicate calls when creating a replicated session to reduce the
+        time taken to create the session and thereby reduce the chances of a
+        subsequent session update message being ignored because the session does
+        not yet exist. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="WebSocket">
     <changelog>
       <update>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message