You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GOMEZ Henri <hg...@slib.fr> on 2001/02/03 03:26:35 UTC

[BUG 235] ajp13 and RequestDispatcher.forward() gotcha !

It's late but I found it.

After some ethereal dumps I noticed that the finish method in
org.apache.tomcat.modules.server.Ajp13Interceptor is called 2 times 
when using forward and so we sent 2 time the END_OF_RESPONSE to 
the Apache Web Server.

So Apache (depending on reqs rate and load) will get the 2nd 
END_OF_RESPONSE just after sending the next request to tomcat.
And it will return a NO RESPONSE to browser

I think Costin will find quickly where the problem come from
(two calls to finish() but a quick hack could be to add 
finished = true in finish() :

=>

    public void finish() throws IOException 
    {
	if(!finished) {
	    super.finish();
	    ajp13.finish();
	    finished = true;
	}
    }
<=

Just think that recycle() reset finished to false ;-(

Re: [BUG 235] ajp13 and RequestDispatcher.forward() gotcha !

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
GOMEZ Henri wrote:

> It's late but I found it.
>
> After some ethereal dumps I noticed that the finish method in
> org.apache.tomcat.modules.server.Ajp13Interceptor is called 2 times
> when using forward and so we sent 2 time the END_OF_RESPONSE to
> the Apache Web Server.
>
> So Apache (depending on reqs rate and load) will get the 2nd
> END_OF_RESPONSE just after sending the next request to tomcat.
> And it will return a NO RESPONSE to browser
>

I recall a similar bug report (and associated fix for 3.2) some time
after 3.2b6.  You might want to browse back through the CVS commits for
November if you want to forward port the fix.

Craig


>
> I think Costin will find quickly where the problem come from
> (two calls to finish() but a quick hack could be to add
> finished = true in finish() :
>
> =>
>
>     public void finish() throws IOException
>     {
>         if(!finished) {
>             super.finish();
>             ajp13.finish();
>             finished = true;
>         }
>     }
> <=
>
> Just think that recycle() reset finished to false ;-(
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org