Skip to content

Rapid concurrent S3 uploads sometimes produce a java.io.IOException: Server failed to send complete response #452

Closed
@ochrons

Description

@ochrons

Expected Behavior

Uploading thousands of files concurrently to S3

Current Behavior

Previously we suffered from #202 but that seems to have been fixed in SDK preview-9. The new problem is similar, except it happens quite rarely, once per tens of thousands of uploads. We use multipart uploading for all uploads.

In one test case I was uploading batches of 1000 files each, running 32 uploads concurrently. The error happened on the first file of the first batch and also on the fifth file on the first batch. All other batches uploaded without errors.

Internally our service extracts individual files from the batches and uploads them to S3 using the new async API, so the total number of concurrent requests to S3 is probably quite high.

The error originates from

public void channelInactive(ChannelHandlerContext handlerCtx) throws Exception {
RequestContext requestCtx = handlerCtx.channel().attr(REQUEST_CONTEXT_KEY).get();
boolean responseCompleted = handlerCtx.channel().attr(RESPONSE_COMPLETE_KEY).get();
if (!responseCompleted) {
runAndLogError("SdkHttpResponseHandler threw an exception when calling exceptionOccurred",
() -> requestCtx.handler().exceptionOccurred(new IOException("Server failed to send complete response")));
runAndLogError("Could not release channel",
() -> requestCtx.channelPool().release(handlerCtx.channel()));
}
}

Steps to Reproduce (for bugs)

Upload lots of files to S3 concurrently.

Your Environment

AWS SDK preview-9
JDK8
AWS Linux
i3.xlarge EC2 instance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Netty NIO ClientbugThis issue is a bug.pending-releaseThis issue will be fixed by an approved PR that hasn't been released yet.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions