You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/12/05 18:43:57 UTC

svn commit: r1643371 - /tomcat/trunk/java/org/apache/catalina/core/

Author: markt
Date: Fri Dec  5 17:43:56 2014
New Revision: 1643371

URL: http://svn.apache.org/r1643371
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57284
Enable startAsync() to be called from a Filter and still be able to call
the remainder of the FilterChain

Modified:
    tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
    tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties
    tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties
    tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Fri Dec  5 17:43:56 2014
@@ -757,17 +757,6 @@ final class ApplicationDispatcher implem
             runtimeException = e;
         }
 
-        // Release the filter chain (if any) for this request
-        try {
-            if (filterChain != null)
-                filterChain.release();
-        } catch (Throwable e) {
-            ExceptionUtils.handleThrowable(e);
-            wrapper.getLogger().error(sm.getString("standardWrapper.releaseFilters",
-                             wrapper.getName()), e);
-            // FIXME: Exception handling needs to be similar to what is in the StandardWrapperValue
-        }
-
         // Deallocate the allocated servlet instance
         try {
             if (servlet != null) {

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java Fri Dec  5 17:43:56 2014
@@ -349,30 +349,6 @@ final class ApplicationFilterChain imple
 
 
     /**
-     * Release references to the filters and wrapper executed by this chain.
-     */
-    void release() {
-
-        for (int i = 0; i < n; i++) {
-            filters[i] = null;
-        }
-        n = 0;
-        pos = 0;
-        servlet = null;
-        support = null;
-
-    }
-
-
-    /**
-     * Prepare for reuse of the filters and wrapper executed by this chain.
-     */
-    void reuse() {
-        pos = 0;
-    }
-
-
-    /**
      * Set the servlet that will be executed at the end of this chain.
      *
      * @param servlet The Wrapper for the servlet to be executed

Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Fri Dec  5 17:43:56 2014
@@ -186,7 +186,6 @@ standardWrapper.notClass=No servlet clas
 standardWrapper.notContext=Parent container of a Wrapper must be a Context
 standardWrapper.notFound=Servlet {0} is not available
 standardWrapper.notServlet=Class {0} is not a Servlet
-standardWrapper.releaseFilters=Release filters exception for servlet {0}
 standardWrapper.serviceException=Servlet.service() for servlet [{0}] in context with path [{1}] threw exception
 standardWrapper.serviceExceptionRoot=Servlet.service() for servlet [{0}] in context with path [{1}] threw exception [{2}] with root cause
 standardWrapper.unavailable=Marking servlet {0} as unavailable

Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties Fri Dec  5 17:43:56 2014
@@ -145,7 +145,6 @@ standardWrapper.notClass = No se ha espe
 standardWrapper.notContext = El contenedor padre para un Arropador (Wrapper) debe de ser un Contexto
 standardWrapper.notFound = No est\u00E1 disponible el Servlet {0}
 standardWrapper.notServlet = La Clase {0} no es un Servlet
-standardWrapper.releaseFilters = Excepci\u00F3n de Liberaci\u00F3n de filtros para servlet {0}
 standardWrapper.serviceException = Servlet.service() para servlet {0} lanz\u00F3 excepci\u00F3n
 standardWrapper.serviceExceptionRoot = El Servlet.service() para el servlet [{0}] en el contexto con ruta [{1}] lanz\u00F3 la excepci\u00F3n [{2}] con causa ra\u00EDz
 standardWrapper.unavailable = Marcando el servlet {0} como no disponible

Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties Fri Dec  5 17:43:56 2014
@@ -81,7 +81,6 @@ standardWrapper.notClass=Aucune classe s
 standardWrapper.notContext=Le conteneur parent d''un enrobeur (wrapper) doit \u00eatre un contexte
 standardWrapper.notFound=Servlet {0} n''est pas disponible.
 standardWrapper.notServlet=La classe {0} n''est pas une servlet
-standardWrapper.releaseFilters=Exception des filtres de sortie (release filters) pour la servlet {0}
 standardWrapper.serviceException="Servlet.service()" pour la servlet {0} a g\u00e9n\u00e9r\u00e9 une exception
 standardWrapper.unavailable=La servlet {0} est marqu\u00e9 comme indisponible
 standardWrapper.unloadException=La servlet {0} a g\u00e9n\u00e9r\u00e9 une exception "unload()"

Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties Fri Dec  5 17:43:56 2014
@@ -82,7 +82,6 @@ standardWrapper.notClass=\u30b5\u30fc\u3
 standardWrapper.notContext=\u30e9\u30c3\u30d1\u306e\u89aa\u306e\u30b3\u30f3\u30c6\u30ca\u306f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093
 standardWrapper.notFound=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u304c\u5229\u7528\u3067\u304d\u307e\u305b\u3093
 standardWrapper.notServlet=\u30af\u30e9\u30b9 {0} \u306f\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093
-standardWrapper.releaseFilters=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u306e\u30d5\u30a3\u30eb\u30bf\u4f8b\u5916\u3092\u89e3\u9664\u3057\u307e\u3059
 standardWrapper.serviceException=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u306eServlet.service()\u304c\u4f8b\u5916\u3092\u6295\u3052\u307e\u3057\u305f
 standardWrapper.unavailable=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u3092\u5229\u7528\u4e0d\u53ef\u80fd\u306b\u30de\u30fc\u30af\u3057\u307e\u3059
 standardWrapper.unloadException=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8 {0} \u304cunload()\u4f8b\u5916\u3092\u6295\u3052\u307e\u3057\u305f

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1643371&r1=1643370&r2=1643371&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Fri Dec  5 17:43:56 2014
@@ -251,11 +251,6 @@ final class StandardWrapperValve
             exception(request, response, e);
         }
 
-        // Release the filter chain (if any) for this request
-        if (filterChain != null) {
-            filterChain.release();
-        }
-
         // Deallocate the allocated servlet instance
         try {
             if (servlet != null) {



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


Re: svn commit: r1643371 - /tomcat/trunk/java/org/apache/catalina/core/

Posted by Mark Thomas <ma...@apache.org>.
On 05/12/2014 22:56, Mark Thomas wrote:
> On 05/12/2014 22:42, Rémy Maucherat wrote:
>> 2014-12-05 23:22 GMT+01:00 Mark Thomas <ma...@apache.org>:
>>
>>>> My Tomcat trunk is quite broken right now (and the ci run isn't looking
>>>> very good). It could be related to this.
>>>
>>> Hmm. I guess I must have missed something. Sorry about that. When I
>>> looked through the code it looked surprisingly harmless.
>>>
>>> There are other fixes (AsynStateMachine, error handling) that I would
>>> have thought would have been more likely to cause problems.
>>>
>>> I'll take a look over the weekend. If this gets in the way before I fix
>>> it and you figure out which commit triggered the issue feel free to
>>> revert it.
>>>
>> I have an apparent recycling issue (the first request to a webapp is fine,
>> but then all others would fail), so I suspected this one. I switched to the
>> revision before and it is fixed.
>> The related bug doesn't sound like it really needs to be fixed. If it
>> causes any impact, it would be better to say it is invalid.
> 
> I think your point re Servlet 6.2.3 is sufficient to revert this and
> resolve the bug as invalid. I'll do that shortly although I do want to
> see if I can figure out what I missed.

I've found the problem. I've reverted my fix.

One question I do have is that I wonder if this was an intended
consequence of adding that language to the spec or whether it was only
meant to apply to non-async mode.

Mark


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


Re: svn commit: r1643371 - /tomcat/trunk/java/org/apache/catalina/core/

Posted by Mark Thomas <ma...@apache.org>.
On 05/12/2014 22:42, Rémy Maucherat wrote:
> 2014-12-05 23:22 GMT+01:00 Mark Thomas <ma...@apache.org>:
> 
>>> My Tomcat trunk is quite broken right now (and the ci run isn't looking
>>> very good). It could be related to this.
>>
>> Hmm. I guess I must have missed something. Sorry about that. When I
>> looked through the code it looked surprisingly harmless.
>>
>> There are other fixes (AsynStateMachine, error handling) that I would
>> have thought would have been more likely to cause problems.
>>
>> I'll take a look over the weekend. If this gets in the way before I fix
>> it and you figure out which commit triggered the issue feel free to
>> revert it.
>>
> I have an apparent recycling issue (the first request to a webapp is fine,
> but then all others would fail), so I suspected this one. I switched to the
> revision before and it is fixed.
> The related bug doesn't sound like it really needs to be fixed. If it
> causes any impact, it would be better to say it is invalid.

I think your point re Servlet 6.2.3 is sufficient to revert this and
resolve the bug as invalid. I'll do that shortly although I do want to
see if I can figure out what I missed.

Mark


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


Re: svn commit: r1643371 - /tomcat/trunk/java/org/apache/catalina/core/

Posted by Rémy Maucherat <re...@apache.org>.
2014-12-05 23:22 GMT+01:00 Mark Thomas <ma...@apache.org>:

> > My Tomcat trunk is quite broken right now (and the ci run isn't looking
> > very good). It could be related to this.
>
> Hmm. I guess I must have missed something. Sorry about that. When I
> looked through the code it looked surprisingly harmless.
>
> There are other fixes (AsynStateMachine, error handling) that I would
> have thought would have been more likely to cause problems.
>
> I'll take a look over the weekend. If this gets in the way before I fix
> it and you figure out which commit triggered the issue feel free to
> revert it.
>
> I have an apparent recycling issue (the first request to a webapp is fine,
but then all others would fail), so I suspected this one. I switched to the
revision before and it is fixed.
The related bug doesn't sound like it really needs to be fixed. If it
causes any impact, it would be better to say it is invalid.

Rémy

Re: svn commit: r1643371 - /tomcat/trunk/java/org/apache/catalina/core/

Posted by Mark Thomas <ma...@apache.org>.
On 05/12/2014 21:20, Rémy Maucherat wrote:
> 2014-12-05 18:43 GMT+01:00 <ma...@apache.org>:
> 
>> Author: markt
>> Date: Fri Dec  5 17:43:56 2014
>> New Revision: 1643371
>>
>> URL: http://svn.apache.org/r1643371
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57284
>> Enable startAsync() to be called from a Filter and still be able to call
>> the remainder of the FilterChain
>>
>> Modified:
>>     tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
>>     tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
>>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
>>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties
>>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties
>>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties
>>     tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
>>
> 
> My Tomcat trunk is quite broken right now (and the ci run isn't looking
> very good). It could be related to this.

Hmm. I guess I must have missed something. Sorry about that. When I
looked through the code it looked surprisingly harmless.

There are other fixes (AsynStateMachine, error handling) that I would
have thought would have been more likely to cause problems.

I'll take a look over the weekend. If this gets in the way before I fix
it and you figure out which commit triggered the issue feel free to
revert it.

Mark


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


Re: svn commit: r1643371 - /tomcat/trunk/java/org/apache/catalina/core/

Posted by Rémy Maucherat <re...@apache.org>.
2014-12-05 18:43 GMT+01:00 <ma...@apache.org>:

> Author: markt
> Date: Fri Dec  5 17:43:56 2014
> New Revision: 1643371
>
> URL: http://svn.apache.org/r1643371
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57284
> Enable startAsync() to be called from a Filter and still be able to call
> the remainder of the FilterChain
>
> Modified:
>     tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
>     tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings_es.properties
>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings_fr.properties
>     tomcat/trunk/java/org/apache/catalina/core/LocalStrings_ja.properties
>     tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
>

My Tomcat trunk is quite broken right now (and the ci run isn't looking
very good). It could be related to this.

Rémy