Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50620
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 20 Jan 2011 18:34:18 +0000 (18:34 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 20 Jan 2011 18:34:18 +0000 (18:34 +0000)
Exceptions calling session.endAccess should not prevent recycle() from completing normally

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1061442 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/LocalStrings.properties
java/org/apache/catalina/connector/Request.java

index a237bc4..1c48aef 100644 (file)
@@ -64,6 +64,7 @@ coyoteRequest.alreadyAuthenticated=This is request has already been authenticate
 coyoteRequest.noLoginConfig=No authentication mechanism has been configured for this context
 coyoteRequest.authenticate.ise=Cannot call authenticate() after the reponse has been committed
 coyoteRequest.uploadLocationInvalid=The temporary upload location [{0}] is not valid
+coyoteRequest.sessionEndAccessFail=Exception triggered ending access to session while recycling request
 
 requestFacade.nullRequest=The request object has been recycled and is no longer associated with this facade
 
index 66ca28c..f77a24b 100644 (file)
@@ -75,6 +75,8 @@ import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.ParameterMap;
 import org.apache.catalina.util.StringParser;
 import org.apache.coyote.ActionCode;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -105,7 +107,8 @@ import org.apache.tomcat.util.res.StringManager;
 public class Request
     implements HttpServletRequest {
 
-
+    private static final Log log = LogFactory.getLog(Connector.class);
+    
     // ----------------------------------------------------------- Constructors
 
 
@@ -492,7 +495,12 @@ public class Request
         cookies = null;
 
         if (session != null) {
-            session.endAccess();
+            try {
+                session.endAccess();
+            } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
+                log.warn(sm.getString("coyoteRequest.sessionEndAccessFail"), t);
+            }
         }
         session = null;
         requestedSessionCookie = false;