Skip to content

Commit

Permalink
Fixed an issue where streaming writes could be misordered.
Browse files Browse the repository at this point in the history
This fixes a cause of "S3: Data read has a different checksum than expected": #953
  • Loading branch information
millems committed Jul 31, 2020
1 parent 411f087 commit 5043ad6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 62 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-AmazonS3-8e7768a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Amazon S3",
"description": "Fixed an issue that could cause \"Data read has a different checksum than expected\" errors."
}
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-NettyNIOHTTPClient-8326112.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Netty NIO HTTP Client",
"description": "Fixed an issue where, under rare circumstances, streaming request bytes could be misordered."
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.util.AttributeKey;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.SdkInternalApi;

Expand All @@ -30,18 +29,11 @@
*/
@SdkInternalApi
public class OrderedWriteChannelHandlerContext extends DelegatingChannelHandlerContext {
private static final AttributeKey<Void> ORDERED =
NettyUtils.getOrCreateAttributeKey("aws.http.nio.netty.async.OrderedWriteChannelHandlerContext.ORDERED");

private OrderedWriteChannelHandlerContext(ChannelHandlerContext delegate) {
super(delegate);
delegate.channel().attr(ORDERED).set(null);
}

public static ChannelHandlerContext wrap(ChannelHandlerContext ctx) {
if (ctx.channel().hasAttr(ORDERED)) {
return ctx;
}
return new OrderedWriteChannelHandlerContext(ctx);
}

Expand Down

This file was deleted.

0 comments on commit 5043ad6

Please sign in to comment.