BREAKING: Report the correct number of bytes when chunking streams #1664
ianbotsf
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Issue smithy-lang/smithy-kotlin#1285 reported that the SDK's source and channel abstractions report an incorrect number of bytes read when the stream is written into a chunked reader for encoding to
aws-chunked
. Specifically, theSdkSource.read()
andAwsChunkedByteReadChannel.read
APIs presently report the number of bytes written to the sink instead of the number of bytes read from the unchunked source. For example, invoking these APIs on a 2,000,000 byte payload may report "reading" up to 2,002,230 bytes, which is actually the number of bytes written including all chunk framing.What's changing
Starting in releases on 8/21 (likely aws-sdk-kotlin v1.5.23), the
SdkSource.read()
andAwsChunkedByteReadChannel.read
APIs will be updated to accurately report the number of bytes read from the unchunked stream. This only affects streaming, chunked payloads which are signed, such as S3'sPutObject
with a body length greater than 1,048,576 bytes. If you do not use or store the values returned fromSdkSource.read
orSdkByteReadChannel.read
then you are unaffected by this change.How to migrate
Carefully review any code you have which directly interacts with
SdkSource.read
orSdkByteReadChannel.read
and verify any assumptions made about the number of bytes that will be returned. In particular, this change may cause those methods to return fewer bytes read on some calls (but not more).More information
For more information about this change, please see bug report smithy-lang/smithy-kotlin#1285 and pull request smithy-lang/smithy-kotlin#1386.
Beta Was this translation helpful? Give feedback.
All reactions