-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Fix S3HttpHandler chunked-encoding handling #72378
Fix S3HttpHandler chunked-encoding handling #72378
Conversation
Pinging @elastic/es-distributed (Team:Distributed) |
The `S3HttpHandler` reads the contents of the uploaded blob, but if the upload used chunked encoding then the reader would skip one or more `\r\n` sequences if they appeared at the start of a chunk. This commit reworks the reader to be stricter about its interpretation of chunks, and removes some indirection via streams since we can work pretty much entirely on the underlying `BytesReference` instead. Closes elastic#72358
16d96ca
to
845e03e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think #72365 is the simpler option, but this one LGTM as well.
If we want to go with this one, can we add https://github.com/elastic/elasticsearch/pull/72365/files#diff-47fd5429e7187cd1b173e53b38a5896c3810c6b89890b84e89334536288c6b84R124 to it to get more (and easier to debug) coverage on this though? :)
Ok I shamelessly pinched some of your ideas from #72365. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing this David
The `S3HttpHandler` reads the contents of the uploaded blob, but if the upload used chunked encoding then the reader would skip one or more `\r\n` sequences if they appeared at the start of a chunk. This commit reworks the reader to be stricter about its interpretation of chunks, and removes some indirection via streams since we can work pretty much entirely on the underlying `BytesReference` instead. Closes #72358
The `S3HttpHandler` reads the contents of the uploaded blob, but if the upload used chunked encoding then the reader would skip one or more `\r\n` sequences if they appeared at the start of a chunk. This commit reworks the reader to be stricter about its interpretation of chunks, and removes some indirection via streams since we can work pretty much entirely on the underlying `BytesReference` instead. Closes #72358
Thanks both 🚀 |
The `S3HttpHandler` reads the contents of the uploaded blob, but if the upload used chunked encoding then the reader would skip one or more `\r\n` sequences if they appeared at the start of a chunk. This commit reworks the reader to be stricter about its interpretation of chunks, and removes some indirection via streams since we can work pretty much entirely on the underlying `BytesReference` instead. Closes #72358
The
S3HttpHandler
reads the contents of the uploaded blob, but if theupload used chunked encoding then the reader would skip one or more
\r\n
sequences if they appeared at the start of a chunk.This commit reworks the reader to be stricter about its interpretation
of chunks, and removes some indirection via streams since we can work
pretty much entirely on the underlying
BytesReference
instead.Closes #72358