Mobile app version of vmapp.org
Login or Join
Tiffany637

: Issues with timed out downloads via TomCat? We get, in our opinion, a lot of failed download attempts and want to understand why. We offer downloads via an email link (typical): http://www.semanticdesigns.com/deliverEval/&l

@Tiffany637

Posted in: #Apache #Download #Error #Jsp

We get, in our opinion, a lot of failed download attempts and want to understand why.

We offer downloads via an email link (typical):

www.semanticdesigns.com/deliverEval/<productname>

This is processed by Tomcat on Linux via a jsp file, with the following code:

response.addHeader( "Content-Disposition", "attachment; filename=" + fileTail );
response.addHeader( "Content-Type", "application/x-msdos-program" );
byte[] buf = new byte[8192];
int read;

try {
java.io.FileInputStream input = new java.io.FileInputStream( filename );
java.io.OutputStream o = response.getOutputStream();
while( ( read = input.read( buf, 0, 8192 ) ) != -1 ){
o.write( buf, 0, read );
}
o.flush();
} catch( Exception e ){
util.fatalError( request.getRequestURI(), "Error sending file '" + filename + "' to client", e );
throw e;
}


We get a lot of reported errors (about 50% error rate):

URI
---
/deliverEval/download.jsp

Code Message: Error sending file '/home/sd/ShippingMasters/DMS/Domains/C/GCC3/Tools/TestCoverage/SD_C~GCC3_TestCoverage.1.6.12.exe' to client

Stack Trace
-----------
null

at org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(byte[], int, int) (Unknown Source)
at org.apache.tomcat.util.buf.ByteChunk.append(byte[], int, int) (Unknown Source)
at org.apache.coyote.tomcat5.OutputBuffer.writeBytes(byte[], int, int) (Unknown Source)
at org.apache.coyote.tomcat5.OutputBuffer.write(byte[], int, int) (Unknown Source)
at org.apache.coyote.tomcat5.CoyoteOutputStream.write(byte[], int, int) (Unknown Source)
at org.apache.jsp.deliverEval.download_jsp._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) (Unknown Source)
at org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) (Unknown Source)
at javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) (Unknown Source)
at org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) (Unknown Source)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) (Unknown Source)
at org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) (Unknown Source)
at javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) (Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) (Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) (Unknown Source)
at org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.Request, org.apache.catalina.Response, org.apache.catalina.ValveContext) (Unknown Source)


We don't understand why this rate should be so high. Is there any way to get more information about the cause of the error?

It is useful to know that these are pretty big documents, 3-50 megabytes. They
reside on the Linux server so reading them is just a local disk read, and is
unlikely to be a contributor to the problem. But sheer size might be an
issue for the recipients browser?

Is this kind of error rate typical for downloads? My personal experience downloading
other's documents suggests no; our internal attempts show this to be very reliable, but we're operating on our internal network for such experiments so we're missing the complexity of the intervening internet.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cody1181609

Is there any way to get more information about the cause of the error?


Add the following to your logging: (I'm no Java guru but I believe that most of the variables you'll need are described in the org.apache.catalina.connector.Request documentation)

Full exception dump - e.toString() - the code sample provided does not differentiate between a client abort versus a failure to open a file so, unless logging occurs elsewhere when the exception is thrown, more information is needed to determine where things are going awry

Client IP, user agent, and HTTP referrer - do many of the requests share a common thread? (e.g. bot, source network, geographic location or distance, browser, linked from another site where download file size is not displayed, etc)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme