Excessive logging on unconsumed request content
- Dominant language
- Java
- Stars
- 4.1k
- Forks
- 2k
- Avg merge
- 3d 56m
- Merged PRs (30d)
- 48
Description
**Jetty version(s)**
12.0.19
**Jetty Environment**
core
**Java version/vendor** `(use: java -version)`
17.0.13
**OS type/version**
AlmaLinux 8
**Description**
We have observed multiple log entries from `org.eclipse.jetty.server.Response.writeError()` in situations when HTTP/2 load exceeds service capacity. We believe this occur on requests where `maxUnconsumedRequestContentReads` is exceeded, when a response is returned prior to fully consuming the response content, as explained in https://github.com/jetty/jetty.project/issues/12079#issuecomment-2298427424.
What's not expected is the attempt of writing a 500 response. This is triggered after a handler writes a response, so I don't expect this event to trigger a code path that tries to write another one. Each failed attempt/request leads to a 'warn' log record.
```
org.eclipse.jetty.server.Response warning writeError: status=500, message=org.eclipse.jetty.util.StaticException: Unconsumed request content, response=ErrorResponse@5c3b0f0d{500,PUT@142348d4 https://domain/path?q=val HTTP/2.0}
```
**How to reproduce?**
- High HTTP/2 load with POST/PUT/PATCH requests with large content.
- Handler that returns response immediately without consuming content.
Contributor guide
Research direction
Start at org.eclipse.jetty.server.Response.writeError() and trace the path involving maxUnconsumedRequestContentReads when a handler returns before consuming POST, PUT, or PATCH content. Reproduce under high HTTP/2 load and verify that an already-written response does not trigger another 500 response or a warning log for unconsumed request content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100