Re: [Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Knut Forkalsrud
Dear Cognoscenti,
We have recently been getting a few requests with abnormal Range
request headers.  For example:

           Accept-Language: zh-cn,zh-hk,zh-tw,en-us
           User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
           Accept: */*
           Host: www.mydomain.com
           Connection: Keep-Alive
           Range: bytes=-335544320--1162852624
           Accept-Encoding: gzip
           X-Forwarded-For: 124.115.0.146

This results in an exception like this:

java.lang.ArrayIndexOutOfBoundsException
  at java.lang.System.arraycopy(Native Method)
  at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
  at 
com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
  at 
com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
  at 
com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
  at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
  at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
  at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
  at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
  at 
com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
  at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
  at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
  at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
  at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
  at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
  at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
  at java.lang.Thread.run(Thread.java:595)

(I'm forwarding the request to the FileServlet).  No harm done here,
the requests seems to fail
without causing any other side effects, but I'm wondering if the
FileServlet should handle the
situation a little more gracefully and give a 4xx response code
instead of throwing an exception,
which ends up being a 5xx response code.

This is Resin 3.1.8 btw.

Thanks,

Knut Forkalsrud


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Alex
Knut,

Thanks for reporting this. I've filed a bug: 
http://bugs.caucho.com/view.php?id=3766

Alex


On 2009-11-16, at 2:59 PM, Knut Forkalsrud wrote:

 Dear Cognoscenti,
 We have recently been getting a few requests with abnormal Range
 request headers.  For example:
 
   Accept-Language: zh-cn,zh-hk,zh-tw,en-us
   User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
   Accept: */*
   Host: www.mydomain.com
   Connection: Keep-Alive
   Range: bytes=-335544320--1162852624
   Accept-Encoding: gzip
   X-Forwarded-For: 124.115.0.146
 
 This results in an exception like this:
 
 java.lang.ArrayIndexOutOfBoundsException
  at java.lang.System.arraycopy(Native Method)
  at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
  at 
 com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
  at 
 com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
  at 
 com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
  at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
  at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
  at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
  at 
 com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
  at 
 com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
  at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
  at 
 com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
  at 
 com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
  at 
 com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
  at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
  at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
  at java.lang.Thread.run(Thread.java:595)
 
 (I'm forwarding the request to the FileServlet).  No harm done here,
 the requests seems to fail
 without causing any other side effects, but I'm wondering if the
 FileServlet should handle the
 situation a little more gracefully and give a 4xx response code
 instead of throwing an exception,
 which ends up being a 5xx response code.
 
 This is Resin 3.1.8 btw.
 
 Thanks,
 
 Knut Forkalsrud
 
 
 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Scott Ferguson
Knut Forkalsrud wrote:
 Dear Cognoscenti,
 We have recently been getting a few requests with abnormal Range
 request headers.  For example:

Accept-Language: zh-cn,zh-hk,zh-tw,en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Accept: */*
Host: www.mydomain.com
Connection: Keep-Alive
Range: bytes=-335544320--1162852624
Accept-Encoding: gzip
X-Forwarded-For: 124.115.0.146

 This results in an exception like this:

 java.lang.ArrayIndexOutOfBoundsException
   

Out of curiosity, what's the actual size of the file? And what kind of 
application? Just browser download or some kind of fancy streaming client.

-- Scott

   at java.lang.System.arraycopy(Native Method)
   at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
   at 
 com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
   at 
 com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
   at 
 com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
   at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
   at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
   at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
   at 
 com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
   at 
 com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
   at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
   at 
 com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
   at 
 com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
   at 
 com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
   at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
   at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
   at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
   at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
   at java.lang.Thread.run(Thread.java:595)

 (I'm forwarding the request to the FileServlet).  No harm done here,
 the requests seems to fail
 without causing any other side effects, but I'm wondering if the
 FileServlet should handle the
 situation a little more gracefully and give a 4xx response code
 instead of throwing an exception,
 which ends up being a 5xx response code.

 This is Resin 3.1.8 btw.

 Thanks,

 Knut Forkalsrud


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Scott Ferguson
Scott Ferguson wrote:
 Knut Forkalsrud wrote:
   
 Dear Cognoscenti,
 We have recently been getting a few requests with abnormal Range
 request headers.  For example:

Accept-Language: zh-cn,zh-hk,zh-tw,en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Accept: */*
Host: www.mydomain.com
Connection: Keep-Alive
Range: bytes=-335544320--1162852624
Accept-Encoding: gzip
X-Forwarded-For: 124.115.0.146

 This results in an exception like this:

 java.lang.ArrayIndexOutOfBoundsException
   
 

 Out of curiosity, what's the actual size of the file? And what kind of 
 application? Just browser download or some kind of fancy streaming client.
   

One specific reason I'm curious is because the 4.0.2 benchmarks vs nginx 
are very, very close even for large static files. (We're already faster 
for small files.)

That may mean we can look at competing in streaming large files directly 
from Resin.

-- Scott
 -- Scott

   
   at java.lang.System.arraycopy(Native Method)
   at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
   at 
 com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
   at 
 com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
   at 
 com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
   at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
   at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
   at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
   at 
 com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
   at 
 com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
   at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
   at 
 com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
   at 
 com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
   at 
 com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
   at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
   at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
   at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
   at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
   at java.lang.Thread.run(Thread.java:595)

 (I'm forwarding the request to the FileServlet).  No harm done here,
 the requests seems to fail
 without causing any other side effects, but I'm wondering if the
 FileServlet should handle the
 situation a little more gracefully and give a 4xx response code
 instead of throwing an exception,
 which ends up being a 5xx response code.

 This is Resin 3.1.8 btw.

 Thanks,

 Knut Forkalsrud


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   
 




 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Knut Forkalsrud
On Mon, Nov 16, 2009 at 15:44, Scott Ferguson f...@caucho.com wrote:
 Out of curiosity, what's the actual size of the file? And what kind of
 application? Just browser download or some kind of fancy streaming client.

The file is small, about 50 bytes.  The app is not fancy, however it
isn't using the typical path mapping constructs in web.xml.  The
reason is that there is business logic related to the hostname (and
path) that is better described in application code than in exotic path
mappings.  As a fallback the requests I don't handle specifically are
forwarded to the file servlet.

 One specific reason I'm curious is because the 4.0.2 benchmarks vs nginx
 are very, very close even for large static files. (We're already faster
 for small files.)

I'm more than happy with the current performance ;-)

-Knut


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest