Additional processing for REFUSED & SERVFAIL rcodes
Merge request reports
Activity
How about just changing this code: https://gitlab.labs.nic.cz/knot/resolver/blob/master/lib/resolve.c#L479-481 The iterator should still return FAIL state, but this code should evaluate how many attempts have we made and allow up to 2-3 retries with the same server before invalidating it for the resolution? I'm generally unhappy with introducing new logic into scoring code, it's quite simple now and I'm afraid special cases for this and that it will bring more side effects.
I can't evaluate how many times particular address has failed without involving any additional logic. IMHO, it requires at least map_t (failed src addr -> counter) at kr_query. It implies map_set() \ map_get(). If exist more cheaper way, explain it, please.
Your variant - retry counter is placed directly at kr_query.kr_nsrep, right? When current ns server returns SERVFAIL & REFUSED, only action - increase fail counter and do not penalize it at rtt cache? When server fails 2-3 times, we must invalidate it? Looks like the fastest way. But ns election process shouldn't be run since it clears kr_query.kr_nsrep. Otherwise additional logic must be involved again... If this is not an issue, i do it, no problem.
Edited by Grigorii Demidovmentioned in commit 8c15fb81