-
Bug
-
Resolution: Done
-
Major
-
7.4.8.GA
-
False
-
None
-
False
-
-
-
-
-
-
-
-
Truncate reponse can happen unexpectedly for request comming through keep-alive connection due to the force connection closure by the write-timeout setting. This is similar to JBEAP-20814 that happened with read-timeout setting. (Note that JBEAP-20814 does not happened for ajp-listener but only for http-listener. However, this issue happens on both http-listener and ajp-listener.)
If I understand correctly, the current write-timeout setting works like the following:
- WriteTimeoutStreamSinkConduit#handleWriteTimeout() checks if currentTime exceeds expireTime of the write-timeout and bump the expireTime if it's not expired.
- The WriteTimeoutStreamSinkConduit#handleWriteTimeout() check is triggered after the write() operation. So, the expiration basically happens when the duration takes longer than write-timeout between the multiple write() operations.
However, the problem is the expireTime in WriteTimeoutStreamSinkConduit never resets to -1 even after completing an exchange (request/response) or before starting an new exchange (request/response). So, the write-timeout can be easily expired for requests that come through the same keep-alive connections.
Also, the write() operation happens actually when flushing content to the response. So, it appears that the WriteTimeoutStreamSinkConduit#handleWriteTimeout() check happens after either of the following:
- after writing out all response content when the response content size is smaller than the default buffer size (16KB)
- after writing each response buffer (16KB) when the response content size is larger than the default buffer size (16KB)
- after an application invokes response flush() of ServletOutputStream (or Servlet Writer) explicitly
So, if the response content size is smaller than the default buffer size (16KB) and an application does not invoke response flush, the check happens after writing all content of the response. So, the problem is not revealed luckily in this scenario.
However, if the response content size is larger than the default buffer size (16KB) or an application invokes response flush() in pieces explicitly, this response truncate issue happens after writing the first buffer.
- is cloned by
-
UNDERTOW-2228 [GSS](7.4.z) Undertow write-timeout can cause a truncate response for request coming through keep-alive connection
- Resolved
-
JBEAP-25257 [GSS](8.0.z) UNDERTOW-2228 - Undertow write-timeout can cause a truncate response for request coming through keep-alive connection
- Closed
- is incorporated by
-
JBEAP-25032 (7.4.z) Upgrade Undertow from 2.2.25.SP3-redhat-00001 to 2.2.26.SP1-redhat-00001
- Closed
- is related to
-
JBEAP-23722 [GSS](7.4.z) UNDERTOW-2241 Undertow write-timeout can cause missing the last zero-length chunk in long polling
- Closed
- relates to
-
JBEAP-24842 [GSS](7.4.z) UNDERTOW-2228 - Undertow write-timeout can cause a closing TCP connection without response for long-running remote EJB request
- Closed