This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 64781c1  Fix BZ 64560 Don't clear DeltaRequest when changing session ID
64781c1 is described below

commit 64781c1311e108acbcc64031c690de1c2fe300ce
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jun 29 21:21:30 2020 +0100

    Fix BZ 64560 Don't clear DeltaRequest when changing session ID
    
    The calls to DeltaSession.setID() are either from creating a new session
    (in which case the DeltaRequest does not need to be reset) or from
    changing the session ID in which pending changes should be retained.
---
 java/org/apache/catalina/ha/session/DeltaSession.java | 10 +++++++---
 webapps/docs/changelog.xml                            |  9 +++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index ae52301..3e4eb8f 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -325,7 +325,12 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
     @Override
     public void setId(String id, boolean notify) {
         super.setId(id, notify);
-        resetDeltaRequest();
+        lockInternal();
+        try {
+            deltaRequest.setSessionId(getIdInternal());
+        } finally{
+            unlockInternal();
+        }
     }
 
 
@@ -337,8 +342,7 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
      */
     @Override
     public void setId(String id) {
-        super.setId(id, true);
-        resetDeltaRequest();
+        setId(id, true);
     }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b1fec98..c92a982 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,15 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Cluster">
+    <changelog>
+      <fix>
+        <bug>64560</bug>: Refactor the replication of a changed session ID for 
a
+        replicated session so that the list of changes associated with the
+        session is not reset when the session ID changes. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <fix>


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

Reply via email to