ServletRequest getInputStream - 读取超时

时间:2012-09-26 19:35:29

标签: java struts

每隔一段时间,在不到一秒的时间内,我会在尝试获取特定请求的发布数据时读取超时。这对我来说非常奇怪,这种情况会发生,我想知道是否有人曾经见过这个。这发生在公共生产Web应用程序中,并且在白天的随机时间发生,每天大约8个实例(每个实例持续一秒或更少,可以看到1到15个读取超时)。这是堆栈跟踪的相关部分:

Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:751)
    at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:781)
    at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
    at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:710)
    at org.apache.coyote.Request.doRead(Request.java:428)
    at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
    at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:403)
    at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
    at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
    at com.offers.util.OffersHttpServletRequest.popuplateReqBytes(OffersHttpServletRequest.java:117)
    at com.offers.util.OffersHttpServletRequest.getPostData(OffersHttpServletRequest.java:64)
    at com.util.TrackAction.getPostData(TrackAction.java:148)
    ... 40 more

---评论中已经回答了这种混淆---

请注意,OffersHttpServletRequest是一个覆盖某些方法的类(getPostData,getInputStream,isSecure,getReader,getRequestURL,getProtocol) - 但是popuplateReqBytes调用super.getInputStream()而不是重写的getInputStream方法。所以我对堆栈跟踪如何从ServletRequestWrapper.getInputStream返回到OffersHttpServletRequest.getInputStream感到困惑。

---结束混乱---

---更新----

根据jtahlborn的观察做出改变后改变了堆栈跟踪。更改没有解决问题。

0 个答案:

没有答案