Skip to content

Apache 5 causing S3 cross-region errors #7047

@kschwarz1116

Description

@kschwarz1116

Describe the bug

With an S3 client with .crossRegionAccessEnabled(true), the recent update has started showing broken pipes on write requests.
Re-enabling expectContinue does not fix the behavior.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Cross region access to continue working out-of-the-box or the functionality to be removed if it is no longer supported.

Current Behavior

Here is a subset of the stack trace:

Caused by: java.net.SocketException: Broken pipe
	at java.base/sun.nio.ch.SocketDispatcher.write0(Native Method)
	at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.tryWrite(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.implWrite(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.write(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl$2.write(Unknown Source)
	at java.base/java.net.Socket$SocketOutputStream.implWrite(Unknown Source)
	at java.base/java.net.Socket$SocketOutputStream.write(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketOutputRecord.deliver(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(Unknown Source)
	at org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:259)
	at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:117)
	at org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:150)
	at org.apache.hc.core5.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:112)
	at org.apache.hc.core5.http.io.entity.InputStreamEntity.writeTo(InputStreamEntity.java:156)
	at org.apache.hc.core5.http.io.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:100)
	at software.amazon.awssdk.http.apache5.internal.RepeatableInputStreamRequestEntity.writeTo(RepeatableInputStreamRequestEntity.java:178)

Reproduction Steps

Attempt writing to S3 with a cross-region client across regions.

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.46

JDK version used

25

Operating System and version

Amazon Linux 2023 (Lambda)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.p1This is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team member

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions