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

Hardcoded upstream timeout #333

Closed
D13410N3 opened this issue Jun 6, 2023 · 1 comment
Closed

Hardcoded upstream timeout #333

D13410N3 opened this issue Jun 6, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@D13410N3
Copy link
Member

D13410N3 commented Jun 6, 2023

Config example:

listen-addrs:
  - 127.0.0.1

listen-ports:
  - 5300

verbose: true

upstream:
  - '2.3.4.5:53'

fallback:
  - '8.8.8.8:53'

2.3.4.5:53 - example of incorrect resolver

Fallback is used only after 20 seconds timeout:

2023/06/06 14:32:27 27924#7 [debug] 2.3.4.5:53: response: exchanging with 2.3.4.5:53 over udp: read udp 10.42.0.121:50883->2.3.4.5:53: i/o timeout
2023/06/06 14:32:27 27924#7 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream 2.3.4.5:53 failed to exchange ;yandex.ru.	IN	 A in 20.001921875s. Cause: exchanging with 2.3.4.5:53 over udp: read udp 10.42.0.121:50883->2.3.4.5:53: i/o timeout
2023/06/06 14:32:27 27924#7 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).replyFromUpstream(): RTT: 20.0020085s
2023/06/06 14:32:27 27924#7 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).replyFromUpstream(): using the fallback upstream due to exchanging with 2.3.4.5:53 over udp: read udp 10.42.0.121:50883->2.3.4.5:53: i/o timeout
2023/06/06 14:32:27 27924#7 [debug] 8.8.8.8:53: sending request A yandex.ru.
2023/06/06 14:32:27 27924#7 [debug] bootstrap: dialing 8.8.8.8:53 (1/1)
2023/06/06 14:32:27 27924#7 [debug] bootstrap: connection to 8.8.8.8:53 succeeded in 256.5µs
2023/06/06 14:32:27 27924#7 [debug] 8.8.8.8:53: response: ok
2023/06/06 14:32:27 27924#7 [debug] 8.8.8.8:53: sending request A yandex.ru.
2023/06/06 14:32:27 27924#7 [debug] bootstrap: dialing 8.8.8.8:53 (1/1)
2023/06/06 14:32:27 27924#7 [debug] bootstrap: connection to 8.8.8.8:53 succeeded in 5.163541ms
2023/06/06 14:32:27 27924#7 [debug] 8.8.8.8:53: response: ok
2023/06/06 14:32:27 27924#7 [debug] upstream 8.8.8.8:53 exchanged ;yandex.ru.	IN	 A successfully in 42.495083ms

It'd be nice if we can set timeout value as flag / config field, instead of hardcoded

@EugeneOne1 EugeneOne1 added the enhancement New feature or request label Jun 6, 2023
@iJorgen
Copy link

iJorgen commented Jun 14, 2023

Should these still be hardcoded or also use the new config-setting?!

defaultTimeout = 10 * time.Second

const dialTimeout = 10 * time.Second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants