Skip to content

Commit 5043ad6

Browse files
committed
Fixed an issue where streaming writes could be misordered.
This fixes a cause of "S3: Data read has a different checksum than expected": #953
1 parent 411f087 commit 5043ad6

File tree

4 files changed

+10
-62
lines changed

4 files changed

+10
-62
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "Amazon S3",
4+
"description": "Fixed an issue that could cause \"Data read has a different checksum than expected\" errors."
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "Netty NIO HTTP Client",
4+
"description": "Fixed an issue where, under rare circumstances, streaming request bytes could be misordered."
5+
}

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/OrderedWriteChannelHandlerContext.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import io.netty.channel.ChannelFuture;
1919
import io.netty.channel.ChannelHandlerContext;
2020
import io.netty.channel.ChannelPromise;
21-
import io.netty.util.AttributeKey;
2221
import java.util.function.Consumer;
2322
import software.amazon.awssdk.annotations.SdkInternalApi;
2423

@@ -30,18 +29,11 @@
3029
*/
3130
@SdkInternalApi
3231
public class OrderedWriteChannelHandlerContext extends DelegatingChannelHandlerContext {
33-
private static final AttributeKey<Void> ORDERED =
34-
NettyUtils.getOrCreateAttributeKey("aws.http.nio.netty.async.OrderedWriteChannelHandlerContext.ORDERED");
35-
3632
private OrderedWriteChannelHandlerContext(ChannelHandlerContext delegate) {
3733
super(delegate);
38-
delegate.channel().attr(ORDERED).set(null);
3934
}
4035

4136
public static ChannelHandlerContext wrap(ChannelHandlerContext ctx) {
42-
if (ctx.channel().hasAttr(ORDERED)) {
43-
return ctx;
44-
}
4537
return new OrderedWriteChannelHandlerContext(ctx);
4638
}
4739

http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/OrderedWriteChannelHandlerContextTest.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)