-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error responsebody truncated when RESPONSE_SET_STATUS_OVER_SEND_ERROR is set #5279
Comments
@jansupol Care to take a look? |
I guess this issue could be closed except for the P.S. The specification states the following:
Jersey now also sets a response entity (message). Shouldn't this be left empty |
I created #5558 for a related issue around this. Setting |
It seems that #5035 introduced some unexpected behaviour. Specifically when the
ResponseWriter
processes unhandled errors and completes theCompletableFuture<ContainerResponse> responseContext
exceptionally. This causes an exception in thewriteResponseStatusAndHeaders
method of theResponseWriter
when response is processed with theDefaultExceptionMapper
.On line 118 the
responseContext
is completed again with the providedContainerResponse
. ThegetResponseContext()
method, on line 128, callsget()
on theCompletableFuture<ContainerResponse>
which results in aExecutionException
which is subsequently wrapped in aContainerException
. This leaves the response in a weird state since theContent-Length
header is set on line 122. Ultimately this results in a truncated error message limited to 141 bytes (which is the length of theDefaultExceptionMapper
default message: "An exception mapping did not successfully produce and processed a response. Logging the exception propagated to the default exception mapper."). This only happens when RESPONSE_SET_STATUS_OVER_SEND_ERROR is set to true.I've created a sample project to demonstrate the issue. When using
JerseyTest
this issue does not occur in theGrizzlyHttpContainer
.P.S. I'd like to challenge the response entity of the
DefaultExceptionMapper
. The specification only calls for the status code to be set. Shouldn't the response remain empty?The text was updated successfully, but these errors were encountered: