-
Notifications
You must be signed in to change notification settings - Fork 73
Failback immediately if reset-after
is set to 0 and new flag to fail on empty responses
#448
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
Conversation
I appreciate that you're copying my commits but do you really want "Anuskuss" ("anal kiss") to show up in your repo history? Just take the code please, it was flawed anyway.
if r.opt.EmptyError {
switch aLen := len(a.Answer); aLen {
case 0: edns0 := a.IsEdns0(); if len(edns0.Option) == 0 || edns0.Option[0].Option() != 15 { return false }
}
} You could also do |
Can you explain what that extra case should do? The way it's written, it'll already return As for using the loop to find any non-CNAME records, the overhead is completely negligible, this won't even show in a CPU profile. I think it's worth for the extra "correctness", no relying on a specific order. This isn't a scripting language so it really doesn't matter in this context. |
Well in the earlier code at the end it would return
Well, cycles are cycles. But if you think it doesn't matter, it probably doesn't matter. |
The logic is becoming too complex and convoluted, I'd rather not add yet another condition based on EDE15. It's quite custom and getting very hard to understand. This may be a another case where having a component whose behavior can be customized by config would be better. I should look into making an element that allows users to provide a Lua snippet to control behavior. |
Well but EDE15 is a deliberate "empty answer" so I personally can't make use |
Can you move the blocklist in front of |
There are also DNS services with internal blocklists, e.g. Cloudlflare for Families, which can return EDE 15 - 17. If the first request to |
I added that check (for all 3 codes), but no time to fully test it. Would you be able to try it out? |
That did the trick but Lines 119 to 121 in 3255afe
|
Hmm, what's wrong with it? Seems correct, it doesn't set a timer when set to 0, which means it'll basically fail-over only for individual requests and start with the same resolver every time which is identical to failing back immediately. |
Well it doesn't do what it's supposed to do. It works with anything other than |
Oh, right. Found the issue and pushed a fix. Try again (with |
👍 |
Based on #444
reset-after
is set to 0 in the config, thefailback
andrandom
groups will reset immediatelyempty-error
flag to specify if empty (or all CNAME) responses should be considered errors. Supported byfailback
,random
, andfail-rotate
TODO: Update the docs