bind9/lib
Ondřej Surý 42e4e3b843 Improve reliability of the netmgr unit tests
The netmgr unit tests were designed to push the system limits to maximum
by sending as many queries as possible in the busy loop from multiple
threads.  This mostly works with UDP, but in the stateful protocol where
establishing the connection takes more time, it failed quite often in
the CI.  On FreeBSD, this happened more often, because the socket() call
would fail spuriosly making the problem even worse.

This commit does several things to improve reliability:

* return value of isc_nm_<proto>connect() is always checked and retried
  when scheduling the connection fails

* The busy while loop has been slowed down with usleep(1000); so the
  netmgr threads could schedule the work and get executed.

* The isc_thread_yield() was replaced with usleep(1000); also to allow
  the other threads to do any work.

* Instead of waiting on just one variable, we wait for multiple
  variables to reach the final value

* We are wrapping the netmgr operations (connects, reads, writes,
  accepts) with reference counting and waiting for all the callbacks to
  be accounted for.

  This has two effects:

  a) the isc_nm_t is always clean of active sockets and handles when
     destroyed, so it will prevent the spurious INSIST(references == 1)
     from isc_nm_destroy()

  b) the unit test now ensures that all the callbacks are always called
     when they should be called, so any stuck test means that there was
     a missing callback call and it is always a real bug

These changes allows us to remove the workaround that would not run
certain tests on systems without port load-balancing.
2021-03-19 16:25:28 +01:00
..
bind9 allow configuration of "default" http endpoint 2021-02-16 16:24:35 -08:00
dns Fully sign a thawed zone 2021-03-17 08:24:17 +01:00
irs Record skipped unit test as skipped in Automake framework 2021-02-15 11:18:03 +01:00
isc Improve reliability of the netmgr unit tests 2021-03-19 16:25:28 +01:00
isccc Record skipped unit test as skipped in Automake framework 2021-02-15 11:18:03 +01:00
isccfg Add purge-keys config option 2021-02-23 09:16:48 +01:00
ns Change the isc_nm_(get|set)timeouts() to work with milliseconds 2021-03-18 16:37:57 +01:00
samples Add libssl libraries to Windows build 2020-11-09 16:00:28 +01:00
win32/bindevt update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
.gitignore Provide unit test driver 2020-05-21 12:13:01 +02:00
Makefile.am Complete rewrite the BIND 9 build system 2020-04-21 14:19:48 +02:00
unit-test-driver.sh.in Provide unit test driver 2020-05-21 12:13:01 +02:00