lib/nsrep: refactor a piece of code
lib/nsrep: fix a bug in choosing when many timed out
Commit 270d9964 was wrong (released in >= 2.4.0). I had reviewed that change carefully,
but still I didn't notice the problem with continue
just above
the changed hunk.
This is yet another logically equivalent change after 270d9964. Now it's written in a way that expresses the original intention more clearly and without copy&paste or long lines.
It seems easiest to verify by inspecting the meaning of the code
separartely for the two cases, based on condition:
cur_addr_score < KR_NS_TIMEOUT
Merge request reports
Activity
I think this mistake contributed significantly to https://gitlab.labs.nic.cz/knot/knot-resolver/issues/470#note_105423
added bug label
@vcunat Any chance to write a test for this?
mentioned in issue #470 (closed)
I'm thinking of simple testing code that simulates the situation that a subset of IPs don't reply at all (configured probability + deterministic pseudo-random choice), by "forgetting" to send UDP packets to those IPs. That could serve as a simple basis for comparison of NS-choosing strategies.
added 14 commits
-
1546dace...fd15bc6c - 13 commits from branch
master
- f13d3ef8 - lib/nsrep: refactor a piece of code
-
1546dace...fd15bc6c - 13 commits from branch
assigned to @vcunat
Uh, I'm sorry for the confusion. I looked again, and all three code states were really performing exactly the same thing :-D now I refactored it again to yet another equivalent state that's supposedly "simplest".
Still, in the process I implemented that simple testing idea in eb90cd34, so we might utilize that work later.
mentioned in commit fb8d0ca0