Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the behaviour of ignoreWriteAfterCommit property to more closely mimic tWAS behaviour #30871

Open
seshadhri-aswath opened this issue Feb 26, 2025 · 0 comments · May be fixed by #30896
Open
Assignees
Labels
in:Transport release bug This bug is present in a released version of Open Liberty team:Sirius

Comments

@seshadhri-aswath
Copy link
Contributor

seshadhri-aswath commented Feb 26, 2025

Describe the bug
The PR 30732 which fixed the issue #30757, introduced a new property ignoreWriteAfterCommit to address the issue of liberty closing the persistent (Keep-Alive) connections if an error occurs with the IO stream when the response is already committed.
While this resolved the immediate problem, this issue aims to further refine the solution to align more closely with the tWAS behaviour of not throwing any exceptions in case if a write is attempted after the response has been committed.

Steps to Reproduce
There are a few ways to reproduce this. 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.

With the ignoreWriteAfterCommit property enabled, Liberty will still throw an java.io.IOException: Invalid state exception if the message was already committed and closes the stream in error state, java.io.IOException: Invalid state but will keep the persistent connection open for the next request.
The socket connection is not closed by the channel / transport.

Expected Behaviour:
Liberty to not to throw an exception and keep the persistent connection open for the next request if the message was committed, to more closely mimic the behaviour of tWAS when the ignoreCommitAfterWrite property is enabled.

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

@seshadhri-aswath seshadhri-aswath self-assigned this Feb 26, 2025
@github-project-automation github-project-automation bot moved this to General Issues in Web Tier Team Feb 26, 2025
@seshadhri-aswath seshadhri-aswath added the release bug This bug is present in a released version of Open Liberty label Feb 28, 2025
@seshadhri-aswath seshadhri-aswath linked a pull request Feb 28, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Transport release bug This bug is present in a released version of Open Liberty team:Sirius
Projects
Status: General Issues
Development

Successfully merging a pull request may close this issue.

2 participants