]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
lib/selection: fix interaction of timeouts with reboots
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 7 Mar 2022 17:04:05 +0000 (18:04 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 14 Mar 2022 06:40:37 +0000 (07:40 +0100)
commit03d24b4b7e5d473bc988551ebc00d955dae01e2b
treead29ff01e859dc7a0d89e8dee18f9a305da0f776
parentb9c2580efc737e518906a14ccccece7fd5b73ef4
lib/selection: fix interaction of timeouts with reboots

We use "monotonic" time-stamps for the dead_since field;
that breaks on system reboots, in which case we reset the stats.
(if the server was categorized as dead)

If the server times out afterwards, we'd fail the condition
`cur_state.consecutive_timeouts == old_state.consecutive_timeouts`
so its stats would not update.  Therefore we'd get stuck forever
in a state where the unusable server has high priority (no_rtt_info).

This commit changes a bit more than was necessary to fix this,
including precision of the stats (in some cases).
NEWS
lib/selection.c
lib/selection.h
lib/selection_forward.c