AWS Android SDK connection timeouts and retries

Viewed 1387

I have been using the AWS android sdk(s) to deal with files on S3 inside my android application. There were some issues that were being faced by the users and few of these are related to connection timeouts. While setting up the AmazonS3client in my application, I have set the timeout and the retries using the following code:

ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setMaxErrorRetry(4);
clientConfiguration.setConnectionTimeout(10000); // default is 10 secs
clientConfiguration.setSocketTimeout(15000); // default is 50 secs

Everywhere I read, it says that the maxErrorRetryonly does retries for failed retryable requests. Do the errors related to the connection timeout and socket connection timeout also come under this category? If not, what is the solution for this case? I have been searching for this for quite some time now but did not get any clear answer on this.

Also, I have been facing two specific exceptions which I get in my TransferListener callback. There are:

  1. Unable to store object contents to disk: Read time out (14% of all the users who face any AWS exception face this exception)
  2. Unable to store object contents to disk: timeout (17.4% of all the users who face any AWS exception face this exception)

The above two are the most painful for us. I have been assuming that these occur because of there is no more storage left on the user device. I have been using the application specific directory in the external storage to store the files and now thinking to move these to the cache so that the system handles the cleaning of files if there is no more space left on the device. Do you think this is a good solution assuming that the problem is running out of space on the user device. What are the other possibilities because of which the above mentioned storage related exceptions can occur?

1 Answers
Related