Bug 68862 - InputBuffer#handleReadException breaks FailedRequestFilter
Summary: InputBuffer#handleReadException breaks FailedRequestFilter
Alias: None
Product: Tomcat 10
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 10.1.18
Hardware: PC All
: P2 normal (vote)
Target Milestone: ------
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2024-04-05 11:27 UTC by Christoph Empl
Modified: 2024-04-09 12:27 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Empl 2024-04-05 11:27:15 UTC
InputBuffer#handleReadException calls (since e77176c) Response#sendError.

If you use FailedRequestFilter and a SocketTimeoutException occurs while parsing request parameters, this change leads to an IllegalStateException in org.apache.catalina.connector.ResponseFacade.checkCommitted: java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
Comment 1 Christoph Empl 2024-04-09 06:50:16 UTC
Correction of my description: InputBuffer calls Response#sendError since https://github.com/apache/tomcat/commit/700d582b508d899aa6dd2d1cc1e42c12e9f47ba0
Comment 2 Remy Maucherat 2024-04-09 08:03:53 UTC
Ok, it is better to fallback when there's a NPE due to commit. The fix will be in 11.0.0-M19, 10.1.21 and 9.0.88.
Comment 3 Christoph Empl 2024-04-09 08:11:15 UTC
I don't think that this commit (https://github.com/apache/tomcat/commit/e7f902bb73c15a75e153c4a25036eabe788d3bb6)  fixes the error to the full extent.
In my use case, the IllegalStateException is thrown when FailedRequestFilter calls Response#sendError.
Comment 4 Remy Maucherat 2024-04-09 08:21:31 UTC
What is FailedRequestFilter ?
Comment 5 Christoph Empl 2024-04-09 08:47:20 UTC
Comment 6 Remy Maucherat 2024-04-09 12:27:58 UTC
This code was removed, so I forgot about it. I added a catch ISE for now in FailedRequestFilter.