bind9/lib/ns
Diego Fronza aab691d512 Fix ns_statscounter_recursclients underflow
The basic scenario for the problem was that in the process of
resolving a query, if any rrset was eligible for prefetching, then it
would trigger a call to query_prefetch(), this call would run in
parallel to the normal query processing.

The problem arises due to the fact that both query_prefetch(), and,
in the original thread, a call to ns_query_recurse(), try to attach
to the recursionquota, but recursing client stats counter is only
incremented if ns_query_recurse() attachs to it first.

Conversely, if fetch_callback() is called before prefetch_done(),
it would not only detach from recursionquota, but also decrement
the stats counter, if query_prefetch() attached to te quota first
that would result in a decrement not matched by an increment, as
expected.

To solve this issue an atomic bool was added, it is set once in
ns_query_recurse(), allowing fetch_callback() to check for it
and decrement stats accordingly.

For a more compreensive explanation check the thread comment below:
https://gitlab.isc.org/isc-projects/bind9/-/issues/1719#note_145857
2020-07-13 11:46:18 -03:00
..
include Fix ns_statscounter_recursclients underflow 2020-07-13 11:46:18 -03:00
tests Fix "make dist" 2020-06-05 13:19:49 +02:00
win32 restore "blackhole" functionality 2020-06-30 17:29:09 -07:00
api Update library API versions 2020-06-18 10:03:05 +02:00
client.c restore "blackhole" functionality 2020-06-30 17:29:09 -07:00
hooks.c Complete rewrite the BIND 9 build system 2020-04-21 14:19:48 +02:00
interfacemgr.c restore "blackhole" functionality 2020-06-30 17:29:09 -07:00
lib.c change "expr == false" to "!expr" in conditionals 2020-05-25 16:09:57 -07:00
listenlist.c Reformat using the new rules 2020-02-14 09:31:05 +01:00
log.c apply the modified style 2020-02-13 15:05:06 -08:00
Makefile.am Fix "make dist" 2020-06-05 13:19:49 +02:00
notify.c apply the modified style 2020-02-13 15:05:06 -08:00
query.c Fix ns_statscounter_recursclients underflow 2020-07-13 11:46:18 -03:00
server.c apply the modified style 2020-02-13 15:05:06 -08:00
sortlist.c apply the modified style 2020-02-13 15:05:06 -08:00
stats.c apply the modified style 2020-02-13 15:05:06 -08:00
update.c Ignore attempts to add DS records at zone apex 2020-06-04 16:00:33 +02:00
xfrout.c Adjust NS_CLIENT_TCP_BUFFER_SIZE and cleanup client_allocsendbuf 2020-06-18 09:59:19 +02:00