eclipse-ee4j / eclipse-ee4j/jersey
tracingLogger response headers not sent when entity exceeds response buffer size
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
If the response contains an entity that is larger than the buffer size of the ResponseWriter (default 8KB), then the tracingLogger's headers (X-Jersey-Tracing-nnn) are never sent to the client. The headers are still being added to the response object, but at that stage the response has already gone out.
If the response entity is smaller than the buffer size, then the client receives the tracing headers correctly.
The cause appears to be in method ServerRuntime#writeResponse, which calls "tracingLogger.flush(response.getHeaders());" very late, which means that CommittingOutputStream has already started sending the response in case of buffer overrun.
Contributor guide
Assessment
This issue has not been assessed yet.