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

mark recoverability of DNS errors correctly #1088

Merged
merged 1 commit into from
Aug 2, 2023
Merged

mark recoverability of DNS errors correctly #1088

merged 1 commit into from
Aug 2, 2023

Conversation

tanmaykm
Copy link
Member

@tanmaykm tanmaykm commented Aug 2, 2023

This changes HTTP client to not retry on certain DNS errors. From the list of possible DNS errors only EAI_AGAIN may be recoverable. This also changes the error code comparison to use UV_EAI_AGAIN, because that is what a DNSError instance would contain.

fixes: #1085

This changes HTTP client to not retry on certain DNS errors. From the [list of possible DNS errors](https://github.com/JuliaLang/julia/blob/ec8df3da3597d0acd503ff85ac84a5f8f73f625b/stdlib/Sockets/src/addrinfo.jl#L108-L112) only EAI_AGAIN may be recoverable. This also changes the error code comparison to use `UV_EAI_AGAIN`, because that is what a [DNSError instance would contain](https://github.com/JuliaLang/julia/blob/ec8df3da3597d0acd503ff85ac84a5f8f73f625b/stdlib/Sockets/src/addrinfo.jl#L108-L112).
@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2023

Codecov Report

Merging #1088 (f4bd74b) into master (10182c0) will decrease coverage by 0.02%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master    #1088      +/-   ##
==========================================
- Coverage   82.33%   82.32%   -0.02%     
==========================================
  Files          32       32              
  Lines        3040     3043       +3     
==========================================
+ Hits         2503     2505       +2     
- Misses        537      538       +1     
Files Changed Coverage Δ
src/clientlayers/RetryRequest.jl 79.16% <75.00%> (-0.84%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tanmaykm tanmaykm requested a review from quinnj August 2, 2023 00:30
@quinnj quinnj merged commit 3dba00f into master Aug 2, 2023
@quinnj quinnj deleted the tan/retry branch August 2, 2023 12:09
@nickrobinson251
Copy link
Collaborator

can we add a test please?

@tanmaykm
Copy link
Member Author

tanmaykm commented Aug 2, 2023

We had faced this in a likely stressed condition in our application. I was testing this with a modified julia binary to artificially throw the DNS error. I found it hard to replicate the error otherwise.

I could add a unit test for isrecoverable, maybe that would be useful?

@tanmaykm
Copy link
Member Author

tanmaykm commented Aug 2, 2023

@nickrobinson251 Actually I think I can add some relevant tests. And I also missed out some more changes to isrecoverable. PR in a bit.

@nickrobinson251
Copy link
Collaborator

I think I can add some relevant tests

Thanks!

a unit test for isrecoverable, maybe that would be useful?

yeah, i think unit tests would be helpful

@tanmaykm tanmaykm changed the title mark recoverability of DNS erros correctly mark recoverability of DNS errors correctly Aug 2, 2023
tanmaykm added a commit that referenced this pull request Aug 2, 2023
Added some tests for `isrecoverable`, particularly for DNS errors.
Added a test for one of the new behaviors, i.e. EAI_NONAME is not retried.

ref: #1088
tanmaykm added a commit that referenced this pull request Aug 2, 2023
Added some tests for `isrecoverable`, particularly for DNS errors.
Added a test for one of the new behaviors, i.e. EAI_NONAME is not retried.
If EAI_EAGAIN is thrown requests are retried.

ref: #1088
quinnj pushed a commit that referenced this pull request Aug 3, 2023
Added some tests for `isrecoverable`, particularly for DNS errors.
Added a test for one of the new behaviors, i.e. EAI_NONAME is not retried.
If EAI_EAGAIN is thrown requests are retried.

ref: #1088
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.

isrecoverable check for DNSErrors seems ineffective and needing correction
4 participants