[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 ;-( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
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 rsoudre les problmes les plus graves avec le mme esprit qui les a cres. -- Albert Einstein -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 03, 2001 3:28 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; 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: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: [BUG 235] ajp13 and RequestDispatcher.forward() gotcha !
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 rsoudre les problmes les plus graves avec le mme esprit qui les a cres. -- Albert Einstein -Original Message- From: GOMEZ Henri [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 03, 2001 3:35 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; 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 rsoudre les problmes les plus graves avec le mme esprit qui les a cres. -- Albert Einstein -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 03, 2001 3:28 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; 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: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]