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

Avoid changing the timeouts selected by user, better handling of iteration timeout and normal timeout #383

Merged
merged 13 commits into from
Jun 11, 2024

Conversation

phillip-stephens
Copy link
Contributor

@phillip-stephens phillip-stephens commented Jun 10, 2024

Closes #363

Changes

  • Remove bool for IterativeResolution in resolver config since we have separate methods and keep it only in the CliConf struct
  • Re-worked this to have better handling of the combined time outs of --timeout and --iteration-timeout
  • Updated documentation
  • Use the new Exchange...Context functions in zmap/dns to pass the timeout context in and get the advantage of failing fast here.
  • Disambiguate the reason for timeout in iterativeLookup

Testing

Was a bit difficult to test, but added a time.Sleep(time.Second) into the lookup section of the code and alternated between --timeout 1 and --iteration-timeout 1 to see what error was returned.

~/zdns/zdns-working on  phillip/363-no-timeout-change! ⌚ 12:11:05
$ echo "amazon.com" | ./zdns A  --iteration-timeout 1 --timeout 4 --iterative
{"data":{"protocol":"","resolver":""},"name":"amazon.com","status":"ITERATIVE_TIMEOUT","timestamp":"2024-06-11T12:11:14+09:00"}

~/zdns/zdns-working on  phillip/363-no-timeout-change! ⌚ 12:11:14
$ echo "amazon.com" | ./zdns A  --iteration-timeout 4 --timeout 1 --iterative
{"data":{"protocol":"","resolver":""},"name":"amazon.com","status":"TIMEOUT","timestamp":"2024-06-11T12:11:27+09:00"}

Note - The status is correctly reported`

@phillip-stephens phillip-stephens marked this pull request as ready for review June 11, 2024 03:12
@phillip-stephens phillip-stephens requested a review from a team as a code owner June 11, 2024 03:12
@phillip-stephens phillip-stephens requested a review from zakird June 11, 2024 03:12
@zakird zakird merged commit 67026d0 into main Jun 11, 2024
4 checks passed
@zakird zakird deleted the phillip/363-no-timeout-change branch June 11, 2024 03:42
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.

Avoid changing the timeouts selected but the user
2 participants