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

Add ability to detect connect timeouts #1711

Merged
merged 1 commit into from Aug 10, 2015

Commits on Aug 3, 2015

  1. Add ability to detect connect timeouts

    It's valuable to be able to detect whether a timeout occurred on the `connect`
    syscall or on the `write`/`read` syscall of an HTTP request - the former
    implies that your client can't reach the server and the latter implies the
    server might not have responded.
    
    For backwards compatibility, and standardization with Unix errno codes, the
    `code` property of connect timeout errors must remain as 'ETIMEDOUT'. Instead
    of changing this value, add a new `connect` property on timeout errors, which
    is set to true if the error occurred on the `connect` attempt. Clients have
    to opt in to checking it - in the common read timeout case, it will be set to
    `false`.
    
    Updates the documentation around each timeout to clarify what is going on, and
    what situations can trigger each timeout.
    
    Updates the README with more accurate documentation about timeout times
    in the wild. I tried `time curl http://10.255.255.1` and `time curl
    http://google.com:81` on four different Linux machines (Heroku, boot2docker,
    Centos on DigitalOcean, a VPS) and the timeout times ranged from 60 seconds to
    120 seconds, much longer than the 20 seconds previously suggested.
    
    Updates the README with information on how to detect connection timeout
    failures.
    kevinburke committed Aug 3, 2015
    Copy the full SHA
    ee4cfbb View commit details
    Browse the repository at this point in the history