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