Skip to content

S3: question about RequestTimeout  #346

Closed

Description

@mikewang2016

When internet network is slow, it's quite common to see error message below during data upload.

RequestTimeout Message: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed

Sometimes, retry can work, but for most of the time, it does not work even after retries several times.

What can cause this problem? And what's "timeout period"?

Activity

  1. JonathanHenson commented on Nov 25, 2016

    @JonathanHenson
    Contributor

    See the ClientConfiguration, there are two parameters you may be interested in. RequestTimeout and ConnectTimeout. They both default to 3 seconds. You probably want to increase the request timeout.

  2. mikewang2016 commented on Nov 25, 2016

    @mikewang2016
    Author

    Yes, I have set ConnectTimeout=10s, RequestTimeout=200s, but can still see this error message.

    I can see that a request may hang for 40s, and then report this error.

  3. mikewang2016 commented on Nov 25, 2016

    @mikewang2016
    Author

    By the way, I am using multiparts upload, every part is about 10MB.

  4. mikewang2016 commented on Nov 27, 2016

    @mikewang2016
    Author

    more information:

    After tested over several networks, I found that this problem only occurs in a network which has packet lost.

    It has nothing to do with network latency: a high latency network can work perfect as long as there is no packet lost.

    If there are packet lost sometimes (not really always), then there is high chance this problem can occur.

    BTW: I am using "Aws::StringStream" to feed "SetBody()" of "UploadPartRequest", if I get RequestTimeout exception from "UploadPart", and want to retry the upload, do I need first rewind by calling "seekg (0, is.beg)" of "Aws::StringStream"?

  5. mikewang2016 commented on Dec 7, 2016

    @mikewang2016
    Author

    Can I have an update on this query?

  6. JonathanHenson commented on Jan 5, 2017

    @JonathanHenson
    Contributor

    Request timeout is supposed to automatically trigger a retry using an exponential backoff strategy. The retry will automatically rewind your stream. If you manually retry, you do need to rewind the stream manually. Though, I would recommend simply injecting a retry strategy into the client configuration to do what you need it to do.

  7. JonathanHenson commented on Feb 8, 2017

    @JonathanHenson
    Contributor

    I just reworked the timeouts for curl implementations to behave more like a socket read timeout. You should be able to set this back to something reasonable (like 3 seconds) and everything will work as it does on windows.

  8. added
    help wanted
    and removed on Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions