Mantis - Resin
Viewing Issue Advanced Details
4025 major random 05-04-10 00:12 05-19-10 15:32
vicsanca  
ferg  
normal  
closed 4.0.6  
fixed  
none    
none 4.0.7  
0004025: sendRedirect fails
In some pages sendRedirect fails where 3.1 works fine. The server seems to try to redirect and in a time fails to redirect.

I get an error in jvm_default.log

java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1206)
at com.caucho.server.hmux.HmuxRequest.onCloseConnection(HmuxRequest.java:1640)
at com.caucho.server.connection.TcpConnection.closeImpl(TcpConnection.java:908)
at com.caucho.server.connection.TcpConnection.destroy(TcpConnection.java:960)
at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:538)
at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100)
at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037)
at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068)
at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901)
at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866)

I'm trying to make some simple code to reproduce error

Notes
(0004548)
vicsanca   
05-04-10 02:30   
Still not able to generate simple code to reproduce it. The pages we use worked fine in 3.1 and 2 versions. The page is not fully correct but worked fine in that versions.

What the pages do:
if (condition) {
   sendRedirect(url)
}
generate html code


We know that the correct one is this:
if (condition) {
    sendRedirect(url)
}
else {
   generate html code
}

but when the application was created we thought that sendRedirect jumped to the page and stop the execution in the correct page.
(0004580)
alex   
05-13-10 16:31   
vicsanca, I wasn't able to reproduce the error. I think it may be caused by a downsizing the buffers in version 4.
Do you use <%@page buffer directive on your page? What's that set to if so?
What are you using for load balancing ( apache / iis / resin ? ) Thanks!
(0004581)
alex   
05-13-10 16:42   
On that same note: sendRedirect should not be failing due to the issue in stacktrace. It can be failing with IllegalStateException if the output has already been flushed due to buffer overflow or an explicit flushing of the buffers.
(0004585)
vicsanca   
05-16-10 23:45   
We use resin with Apache 2.2 and mod_caucho.so.
We don't use buffer directive.
We are able to reproduce the error in our application but not to generate simple code to post you.
(0004586)
vicsanca   
05-17-10 05:46   
Yes seems that adding buffer page directive with a high value works:
1kb - fails
8kb - fails
16kb - works :)

It's a bug or there is an option for increasing default buffer for all pages without the buffer directive?
(0004588)
alex   
05-17-10 08:02   
Thanks for clarification. You can include the <%@ page buffer using <jsp-config include-prelude.
(0004591)
vicsanca   
05-17-10 23:58   
What buffer size it's configured by default in 3.1.x?
It's possible to change it in 4.0 in source code before compiling to put the same? if possible where is the buffer size in source code?

Thanks
(0004597)
ferg   
05-19-10 15:32   
server/265b