eclipse-ee4j / eclipse-ee4j/jersey

tracingLogger response headers not sent when entity exceeds response buffer size

Open
#4,558 0 comments 1 reaction 0 assignees View on GitHub
tracing
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.