Search code examples
iosamazon-web-servicestimeout

Using AWSS3TransferManagerUploadRequest how to set the timeout interval?


Currently I am using the AWS Mobile SDK for iOS v2.0.6 and performing upload and download. When I transfer 8 MB and more size file I am frequently receiving "time out" error or "network connection lost" error from Amazon services.

How can I increase timeout interval or how to set max retry count?

Here is how I initiate upload request:

AWSS3TransferManagerUploadRequest *uploadRequest = [AWSS3TransferManagerUploadRequest new];
[[[AWSS3TransferManager defaultS3TransferManager] upload:uploadRequest] continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:^id(BFTask *task)

And also am using default s3 manager i.e.,

[AWSS3TransferManager defaultS3TransferManager]

Below is the error I get:

User info---{
    NSErrorFailingURLKey = "https://s3.amazonaws.com/bucketname/Multimedia/Audio/20141023/AUDIO_646E98B7-D688-4923-9BEB-1E8CDF233027.caf";
    NSErrorFailingURLStringKey = "https://s3.amazonaws.com/bucketname/Multimedia/Audio/20141023/AUDIO_646E98B7-D688-4923-9BEB-1E8CDF233027.caf";
    NSLocalizedDescription = "The request timed out.";
    NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1001 \"The request timed out.\" UserInfo=0x16bb3a00 {NSErrorFailingURLKey=https://s3.amazonaws.com/bucketname/Multimedia/Audio/20141023/AUDIO_646E98B7-D688-4923-9BEB-1E8CDF233027.caf, NSErrorFailingURLStringKey=https://s3.amazonaws.com/bucketname/Multimedia/Audio/20141023/AUDIO_646E98B7-D688-4923-9BEB-1E8CDF233027.caf, NSLocalizedDescription=The request timed out.}";
}

Solution

  • AWSServiceConfiguration has a property called maxRetryCount. You can set it to an appropriate value for your use case.

    Also, the latest version of the SDK contains many bug fixes, so please make sure to update your copy at your earliest convenience.