Skip to content

Conversation

@bradh352
Copy link
Member

UDP is connectionless, but systems use ICMP unreachable messages to indicate there is no ability to reach the host or port, which can result in a send() returning an error like ECONNREFUSED. We need to handle non-retryable codes like that to treat it as a connection failure so we requeue any queries on that connection to another connection/server immediately. Otherwise what happens is we just wait on the timeout to expire which can greatly increase the time required to get a definitive message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)

@bradh352 bradh352 merged commit a548eab into c-ares:main Jul 19, 2024
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
bradh352 added a commit that referenced this pull request Jul 19, 2024
UDP is connectionless, but systems use ICMP unreachable messages to
indicate there is no ability to reach the host or port, which can result
in a `send()` returning an error like `ECONNREFUSED`. We need to handle
non-retryable codes like that to treat it as a connection failure so we
requeue any queries on that connection to another connection/server
immediately. Otherwise what happens is we just wait on the timeout to
expire which can greatly increase the time required to get a definitive
message.

This also adds a test case to verify the behavior.

Fixes #819
Fix By: Brad Houes (@bradh352)
@bradh352 bradh352 deleted the udpquickfail branch July 21, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent delay between retries to non-listening ports

1 participant