tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GOMEZ Henri <hgo...@slib.fr>
Subject RE: [BUG 235] ajp13 and RequestDispatcher.forward() gotcha !
Date Sat, 03 Feb 2001 02:40:47 GMT
You could easily reproduce the bugs playing with :

This one works

http://yourhost:8080/examples/servlet/servletToJsp

with mod_jk this one fail (reload X times)

http://yourhost/examples/servlet/servletToJsp


On ne peut résoudre les problèmes les plus graves avec le même esprit qui
les a crées.
-- Albert Einstein 

>-----Original Message-----
>From: GOMEZ Henri [mailto:hgomez@slib.fr]
>Sent: Saturday, February 03, 2001 3:35 AM
>To: tomcat-dev@jakarta.apache.org
>Cc: cmanolache@yahoo.com; Dan Milstein; Craig R. McClanahan
>Subject: RE: [BUG 235] ajp13 and RequestDispatcher.forward() gotcha !
>
>
>TC 3.2.1 seems fixed.
>
>I just take a look at code and saw that the finished = true;
>is present in 
>org.apache.tomcat.service.connector.Ajp13ConnectorResponse !-)
>
>    public void finish() throws IOException 
>    {
>        if (!finished) {
>            super.finish();
>            finished = true;
>            MsgBuffer msg = con.getMsgBuffer();
>            msg.reset();
>            msg.appendByte(JK_AJP13_END_RESPONSE);
>            msg.appendByte((byte)1);        
>            msg.end();
>            con.send(msg);
>        }
>    }
>    
>And before the send which may safer, so my code come to =>
>
>     public void finish() throws IOException
>     {
>         if(!finished) {
>             finished = true;
>             super.finish();
>             ajp13.finish();
>         }
>     }
>
>On ne peut résoudre les problèmes les plus graves avec le même 
>esprit qui
>les a crées.
>-- Albert Einstein 
>
>>-----Original Message-----
>>From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
>>Sent: Saturday, February 03, 2001 3:28 AM
>>To: tomcat-dev@jakarta.apache.org
>>Cc: cmanolache@yahoo.com; Dan Milstein
>>Subject: Re: [BUG 235] ajp13 and RequestDispatcher.forward() gotcha !
>>
>>
>>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
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>For additional commands, email: tomcat-dev-help@jakarta.apache.org
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, email: tomcat-dev-help@jakarta.apache.org
>

Mime
View raw message