Skip to content
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

Return proxied response body for all status codes #153

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

mosiac1
Copy link
Contributor

@mosiac1 mosiac1 commented Sep 18, 2024

Reading a missing bucket/key will result in a 500 with the error "Insufficient content written 0 < x" (where X is a the expected content size) which seems to be a Jetty error.

The aws-proxy correctly logs that the response from MinIO has status 404 and the Content-Length header is set. With a breakpoint I confirmed that the response from MinIO has the same size as Content-Length, so I'm not sure why Jetty doesn't get any content.

Will continue investigating.

@mosiac1
Copy link
Contributor Author

mosiac1 commented Sep 19, 2024

Found that StreamingResponseHandler did not stream the body of non-2XX responses but would send the original Content-Length header which would have a non-0 value, triggering the Jetty error that not enough content was written.

Updated StreamingResponseHandler to always include the body and added tests for all status codes that the S3 spec lists.

Created #154

Copy link
Member

@vagaerg vagaerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mosiac1 mosiac1 changed the title Add test for missing bucket or key Return proxied response body for all status codes Sep 19, 2024
@mosiac1 mosiac1 merged commit 3cd6897 into trinodb:main Sep 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants