bind9/util
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
..
bindkeys.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
branchsync.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-categories.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-changes update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-cocci Run the check-cocci on the whole tree, allow passing extra arguments 2020-02-08 03:12:09 -08:00
check-includes.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-instincludes.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-line-length.sh Detect overly long CHANGES lines 2021-01-28 13:49:02 +11:00
check-make-install.in update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-pullups.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-sources.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
check-win32util-configure update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
checklibs.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
commit-arm.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
COPYRIGHT fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
COPYRIGHT.BRIEF fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
COPYRIGHT.BSDI fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
COPYRIGHT.NAI fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
COPYRIGHT.NOM fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
COPYRIGHT.PORTION fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
COPYRIGHT.TOP fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
copyrights Improve reliability of the netmgr unit tests 2021-03-19 16:25:28 +01:00
git-replay-merge.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
kit.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
mandoc2docbook.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
mdnbuildtest.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
memleak.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
merge_copyrights Add the ISC DNSSEC Guide as a BIND 9 ARM appendix 2021-01-08 13:12:20 +01:00
models.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
nanny.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
new-func update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
nt-kit update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
pairwise-testing.sh Do not remove stderr from pict output 2021-02-23 15:23:58 +01:00
parse_tsan.py update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
run-clang-tidy Add copy of run-clang-tidy that can fixup the filepaths 2020-02-13 22:06:05 +01:00
spacewhack.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
suppressions.txt Refactor netmgr and add more unit tests 2020-12-01 16:47:07 +01:00
tabify-changes update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
unused-headers.sh Add unused headers check to CI 2020-11-11 10:08:12 +01:00
update-drafts.pl update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
update_branches update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
update_copyrights update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00