-
Notifications
You must be signed in to change notification settings - Fork 550
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: Read timed out problem #119
Comments
@tomkhan Increase socket timeout via ClientConfiguration.setSocketTimeout(int). |
@fosterzhang Thanks for your help. But I'm pretty sure that there is some problem in the SDK with this. Because, even though I get that SocketTimeoutException and my inner logic (after that) stops trying to send that picture, some background thread in your SDK is still sending the image and it comes to my server correctly, even though that exception is thrown. |
@tomkhan I noticed some issue with interrupting an ongoing transfer. Trying to improve it. Stay tuned. |
@tomkhan This should be fixed in v2.2.16. For detailed changes, please refer to the change log. |
Hi @fosterzhang how can I update it to that version? My current gradle configuration has this: |
@tomkhan The latest version is 2.2.16. Please update 2.2.9 to 2.2.16. |
Oh. I forgot that the two digit numbers are going after one digit numbers (kidding, was thinking that you were incrementing from the right side, like 91 :)) Thank @fosterzhang will try and get back here. |
@fosterzhang I'm afraid it didn't help. I've put the old code back, removed the timeout: Initialized with only: And updated gradle with: When I try to send picture to my web (first I upload its thumb, then the original picture), there is no longer that old warning, but this: After some time, both pictures get to my server and are shown there, but the mobile is showing an error because TransferObserver is saying upload failed. |
@tomkhan is there a reliable way to reproduce it? What I don't understand is that the upload succeeded eventually while the state said no. If you are on a relatively poor network, I suggest your increase socket timeout. What I changed in the latest version is that transfer service does a check of network status when socket time out occurs and will change the transfer to waiting for network if network is indeed out. When the upload is marked as failed, that really means some unresolvable network issue and the upload won't complete itself. |
I can only reproduce it with Genymotion simulating GPRS network. When sending large picture (3+ MB), that timeout occurs will give me failed response (also, I forgot to mention, I'm using this solution to check the state #91). But somehow, it will complete the upload in the background (knowing this by the picture visible on the server in a minute or two). For now, increasing socket timeout is the solution. |
I also had this issue and I resolved it while going through multiple stackoverflow /github /aws doc pages. leaving a link to my documentation below for whomsoever may need it. |
Hello.
I'm simulating bad network environment (with Genymotion - GPRS network). When trying to send an image using TransferUtility upload method, I'm getting (after some 15 seconds) an error in logcat:
In my code, I have a sync mechanism that occur after pull to refresh on some screens. It collects unsynced data and when syncing photos, I use response from aws sdk to determine if the photo is synced or not.
To make things worse, my image in this case (when simulating bad network) do come to the aws folder correctly, but aws sdk is giving me TransferState.FAILED for the TransferObserver object so my sync mechanism will again collect that photo to sync.
When I get back to "normal" connection, aws will get back TransferState.COMPLETED and my sync mechanism will now know that the picture did upload correctly, even though it already exists on Amazon S3.
Is there a way to set a longer period for timeout? Or handle this somehow?
Thanks.
The text was updated successfully, but these errors were encountered: