Samrat002 commented on PR #27965:
URL: https://github.com/apache/flink/pull/27965#issuecomment-4278005257
Thank you @macdoor for raising the patch.
i have a fundamental query associate with this change.
is the problem true for AWS S3?
As per my analysis , Premature end of Content-Length delimited message body
can only occur when the server closes the TCP connection before delivering all
Content-Length bytes. This is an HTTP/1.1 protocol violation.
AWS S3 does not do this. S3 always delivers exactly the number of bytes
promised in Content-Length. The drain loop in Apache `HttpClient's
ContentLengthInputStream.close()` will always succeed against real S3. It may
be slow (reading GBs to discard), but it will never hit a premature EOF.
The only valid concern for real S3 is performance. I see probable
improvement is draining large amounts of unread data on close() just to reuse a
connection.
The SDK JavaDoc says it plainly:
> "If it is not desired to read remaining data from the stream, you can
explicitly abort the connection via abort() instead. This will close the
underlying connection and require establishing a new HTTP connection on
subsequent requests which may outweigh the cost of reading the additional data."
reference :
https://github.com/aws/aws-sdk-java-v2/blob/master/core/sdk-core/src/main/java/software/amazon/awssdk/core/ResponseInputStream.java#L52
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]