Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketTimeoutException when uploading big files to Google Drive #853

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link
Collaborator

google-api-java-client 1.15.0-rc

Java environment:  Java 5

When I try upload file ~1.5Gb to Google Drive I've got 
java.net.SocketTimeoutException.
I use MediaHttpUploader in resumeable mode + configured IOExceptionHandler and 
UnsuccessfulResponseHandler with ExponentialBackOff:
HttpBackOffUnsuccessfulResponseHandler responseHandler = new 
HttpBackOffUnsuccessfulResponseHandler(new ExponentialBackOff());
request.setUnsuccessfulResponseHandler(responseHandler);
request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler(new 
ExponentialBackOff()));
request.setConnectTimeout(40000);
request.setReadTimeout(100000);

So file started uploading by chunks and after some time GDrive could fire 
exception indicating that token expiration or any other exception could happen. 
So MediaUploader is trying to retry request. It sends it again (token refreshed 
successfully) but got timeout exception, then backoff is triggered and it 
request was sent again, bug got same result - socket timeout. It tries 10 
times, overall several minutes - same effect. So upload is canceled and our 
application, after some time, tries to repeat file upload, but same issue rised 
again - in case any errors happened while file uploading, socket timeout 
exception thrown and no chance to resume uploading.
I've attached

Original issue reported on code.google.com by ArmenPol...@gmail.com on 15 Jan 2014 at 10:43

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant