You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Liberty closes persistent (Keep-Alive) connections if an error occurs with the IO stream when the response is already committed.
[1/15/25, 0:02:59:032 PST] 00000036 HttpDispatche 3 Error closing stream; java.io.IOException: Invalid state [1/15/25, 0:02:59:032 PST] 00000036 HttpDispatche < closeStreams Exit java.io.IOException: Invalid state at com.ibm.ws.http.channel.internal.outbound.HttpOutputStreamImpl.flushBuffers(HttpOutputStreamImpl.java:554)
This causes issues when the request is routed through IBM HTTP Server (IHS) plugin, resulting in 500 Internal Server Error. This also causes issues from a client side with the socket closing from the server when the client would expect it to be open to continue reading and writing to it. It depends on the client implementation the specific type of issue that could be seen.
Steps to Reproduce
There are a few ways this error can occur. Here is one example:
Hit as JSP that calls HttpServletResponse#sendRedirect (scriptlet code) to another page.
The same JSP then writes out more data (via jsp:include, for instance)
Webcontainer is handling the redirect, but the response is committed (caused by the additional data written) which leads to an invalid state.
The socket connection is closed by the channel / transport.
Expected behavior
The stream should remain open. This was be behavior in Traditional WebSphere, but was changed in Liberty. A new property will be introduced to restore the older Traditional WebSphere behavior if opted in.
Diagnostic information:
OpenLiberty Version: ALL
Affected feature(s) Any features which rely on servlet. (i.e servlet-3.1, servlet-4.0, etc)
Java Version: N/A
server.xml configuration N/A
Additional context
The 500 error response occurs when IHS is used. Users may also experience a java.net.SocketException: Connection reset and other SocketExceptions depending on the client implementation used for driving the request.
Describe the bug
Liberty closes persistent (Keep-Alive) connections if an error occurs with the IO stream when the response is already committed.
[1/15/25, 0:02:59:032 PST] 00000036 HttpDispatche 3 Error closing stream; java.io.IOException: Invalid state [1/15/25, 0:02:59:032 PST] 00000036 HttpDispatche < closeStreams Exit java.io.IOException: Invalid state at com.ibm.ws.http.channel.internal.outbound.HttpOutputStreamImpl.flushBuffers(HttpOutputStreamImpl.java:554)
This causes issues when the request is routed through IBM HTTP Server (IHS) plugin, resulting in 500 Internal Server Error. This also causes issues from a client side with the socket closing from the server when the client would expect it to be open to continue reading and writing to it. It depends on the client implementation the specific type of issue that could be seen.
Steps to Reproduce
There are a few ways this error can occur. Here is one example:
Expected behavior
The stream should remain open. This was be behavior in Traditional WebSphere, but was changed in Liberty. A new property will be introduced to restore the older Traditional WebSphere behavior if opted in.
Diagnostic information:
Additional context
The 500 error response occurs when IHS is used. Users may also experience a
java.net.SocketException: Connection reset
and other SocketExceptions depending on the client implementation used for driving the request.New HTTP Option:
The text was updated successfully, but these errors were encountered: