Avoid NPE when a parallel request invalidates the current session
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Sep 2010 14:39:48 +0000 (14:39 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Sep 2010 14:39:48 +0000 (14:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@993042 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/session/DeltaManager.java
webapps/docs/changelog.xml

index 949d424..1388efd 100644 (file)
@@ -1033,6 +1033,11 @@ public class DeltaManager extends ClusterManagerBase{
         DeltaSession session = null;
         try {
             session = (DeltaSession) findSession(sessionId);
+            if (session == null) {
+                // A parallel request has called session.invalidate() which has
+                // remove the session from the Manager.
+                return null;
+            }
             DeltaRequest deltaRequest = session.getDeltaRequest();
             session.lock();
             SessionMessage msg = null;
index 80a53fb..4c4cbf8 100644 (file)
         Add support for LAST_ACCESS_AT_START system property to DeltaSession. 
         (kfujino)
       </fix>
+      <fix>
+        Avoid a NPE in the DeltaManager when a parallel request invalidates the
+        session before the current request has a chance to send the replication
+        message. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">