-
Notifications
You must be signed in to change notification settings - Fork 174
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
Allow a connection attempt to timeout and keep trying resolved addresses #618
Conversation
The intention is that Is your problem that the failing socket address takes longer than 30 seconds to fail? |
My problem is that there's no And when that fails the request is aborted by this line. Line 372 in ec663fa
edit: My first address never responds |
As far as I know all OSes will timeout socket connection attempts at some point. Some quick googling seems to say for windows it's 72 seconds and for Linux 60 seconds. In many cases I would image the timeout to be shorter. For example, if the host is there, but port closed, the SYN would be responded with an RST and the fail be instant. The 30 second value is for the overall the connection attempt, not per socket addr. On your host, could you try lowering the OS default timeout and see if that helps? I wonder what cURL does here, does it fail faster than the OS so it can try more addresses? |
Curl failed over pretty much instantly when it was happening. It seems the Spotify server is no longer non-responsive for the first host, so unable to recreate right now. |
Added a testcase to this PR I would need to setup a DNS server to compare. |
Well, found why curl worked. It attempts the first two entries at the same time. They also set the addr connection attempt to |
Right. That seems reasonable. We could do that too. if there are at least two addresses, split |
Updated the PR.
|
Let's land this. Thanks! |
Before this change
connect_host
only attempted to connect to the first resolved SocketAddr.My interpretation was that this was the indented use of
agent.config.timeout_connect
but, I'm unsure as the default value seems to be 30 sec.Breaking change for any projects depending on the
timeout_connect
config, maybe introduce a separate configuration for this timeout.