[tomcat] branch 9.0.x updated: Fix BZ 64560 Don't clear DeltaRequest when changing session ID

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat] branch 9.0.x updated: Fix BZ 64560 Don't clear DeltaRequest when changing session ID

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

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


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

commit 61d52391532b01d11870fe91db37a360a1c899d4
Author: Mark Thomas <[hidden email]>
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 07394e4..ac97228 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -118,6 +118,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: [hidden email]
For additional commands, e-mail: [hidden email]