0

I'm developing app, which uploads short videos to Amazon S3 (about 5Mb). But sometimes (about 1 uploading of 5) hangs for long time (about 1min), then progress goes from the beginning and uploading is finished. Sometimes this happens twice during 1 uploading. From debug output I figured out, that Code=-1001 "The request timed out." happens, and then S3 SDK restarts request silently.

Uploading code is next:

request = [[AWSS3TransferManagerUploadRequest alloc] init]; // request is strong ref
request.bucket = kS3BucketName;
request.key = s3VideoKey;
request.body = videoFileUrl;
request.ACL = AWSS3BucketCannedACLPublicRead;

request.uploadProgress = ^ (int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
    NSLog(@"Progress: %lld", totalBytesSent);
};

AWSS3TransferManager *transferManager = [AWSS3TransferManager defaultS3TransferManager];
task = [transferManager upload:request]; // task is strong ref
[task continueWithExecutor:[AWSExecutor mainThreadExecutor] withBlock: ^id (AWSTask *task) {
    if (task.error != nil) {
        NSLog(@"Error %@", task.error);
    }
    else {
        NSLog(@"download completed");
    }
    [self requestIsFinished];

    return nil;
}];

Found similar issue here: Amazon S3 video upload issue for the iOS SDK v2 and made 'request' and 'task' strong references, but it didn't help.

Have someone faced with the same issue?

Thanks

Community
  • 1
  • 1
Serhiy
  • 333
  • 5
  • 12
  • Hope you can find your answer in this link http://stackoverflow.com/questions/26972822/error-error-domain-nsurlerrordomain-code-1001-the-request-timed-out – arunjos007 Sep 26 '16 at 12:15
  • @arunjos007 thanks for link. That issue happens only on simulator, but mine happens on different devices and seems is connected to Amazon SDK – Serhiy Sep 26 '16 at 15:24
  • @Serhii Are you still having this problem? I was not able to reproduce on my end using most of your code. – donkon Dec 13 '16 at 19:21
  • @donkon I decided to remove AWS SDK and did uploading by raw HTTP request. Now everything work great. Seems, some issue inside AWS SDK... Probably, something related to memory management – Serhiy Dec 14 '16 at 07:59

0 Answers0