Skip to content

Commit

Permalink
Fix BZ 69471
Browse files Browse the repository at this point in the history
Log instances of CloseNowException caught by
ApplicationDispatcher.invoke() at debug level rather than error level as
they are very likely to have been caused by a client disconnection or
similar I/O issue.

https://bz.apache.org/bugzilla/show_bug.cgi?id=69471
  • Loading branch information
markt-asf committed Nov 22, 2024
1 parent a7fff9c commit 3a17b1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/org/apache/catalina/core/ApplicationDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.connector.ResponseFacade;
import org.apache.coyote.BadRequestException;
import org.apache.coyote.CloseNowException;
import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.res.StringManager;

Expand Down Expand Up @@ -538,7 +539,7 @@ private void invoke(ServletRequest request, ServletResponse response, State stat
filterChain.doFilter(request, response);
}
// Servlet Service Method is called by the FilterChain
} catch (BadRequestException e) {
} catch (BadRequestException | CloseNowException e) {
ioException = e;
} catch (IOException e) {
wrapper.getLogger().error(sm.getString("applicationDispatcher.serviceException", wrapper.getName()), e);
Expand Down
6 changes: 6 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@
some headers, as per RFC 9110, section 9.3.2, that are present in a GET
request that are not present in the equivalent HEAD request. (markt)
</fix>
<fix>
<bug>69471</bug>: Log instances of <code>CloseNowException</code> caught
by <code>ApplicationDispatcher.invoke()</code> at debug level rather
than error level as they are very likely to have been caused by a client
disconnection or similar I/O issue. (markt)
</fix>
</changelog>
</subsection>
<subsection name="Coyote">
Expand Down

0 comments on commit 3a17b1d

Please sign in to comment.