tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1519392 - in /tomcat/trunk/java/org/apache: catalina/connector/CoyoteAdapter.java coyote/ajp/AbstractAjpProcessor.java coyote/http11/AbstractHttp11Processor.java
Date Mon, 02 Sep 2013 11:15:02 GMT
Author: markt
Date: Mon Sep  2 11:15:01 2013
New Revision: 1519392

URL: http://svn.apache.org/r1519392
Log:
Fix Gump failure (hopefully)
Move the log failure to the adapter so that the logging occurs before the request and response
are recycled. This should improve the information that appears in the logs.
The failure was caused because Gump runs with access logs enabled so when the failure occurred
the context had been set to null. This meant the the default access logging kicked in which
found the standard host level log and logged the issue there rather than in the context level
TesterAccessLog.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1519392&r1=1519391&r2=1519392&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Mon Sep  2 11:15:01
2013
@@ -439,6 +439,14 @@ public class CoyoteAdapter implements Ad
             success = false;
             log.error(sm.getString("coyoteAdapter.asyncDispatch"), t);
         } finally {
+            if (!success) {
+                res.setStatus(500);
+                long time = 0;
+                if (req.getStartTime() != -1) {
+                    time = System.currentTimeMillis() - req.getStartTime();
+                }
+                log(req, res, time);
+            }
             req.getRequestProcessor().setWorkerThreadName(null);
             // Recycle the wrapper request and response
             if (!success || (!comet && !request.isAsync())) {

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1519392&r1=1519391&r2=1519392&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Mon Sep  2 11:15:01
2013
@@ -554,12 +554,6 @@ public abstract class AbstractAjpProcess
             ExceptionUtils.handleThrowable(t);
             getLog().error(sm.getString("http11processor.request.process"), t);
             error = true;
-        } finally {
-            if (error) {
-                // 500 - Internal Server Error
-                response.setStatus(500);
-                getAdapter().log(request, response, 0);
-            }
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1519392&r1=1519391&r2=1519392&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Mon Sep  2 11:15:01
2013
@@ -1604,16 +1604,6 @@ public abstract class AbstractHttp11Proc
             ExceptionUtils.handleThrowable(t);
             getLog().error(sm.getString("http11processor.request.process"), t);
             error = true;
-        } finally {
-            if (error) {
-                // 500 - Internal Server Error
-                response.setStatus(500);
-                long time = 0;
-                if (request.getStartTime() != -1) {
-                    time = System.currentTimeMillis() - request.getStartTime();
-                }
-                getAdapter().log(request, response, time);
-            }
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);



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


Mime
View raw message