1. 20 Mar, 2021 4 commits
    • Evan Hunt's avatar
      Merge branch '2592-dig-clock-realtime' into 'main' · 8e0902b7
      Evan Hunt authored
      Resolve "dig -u is extremely inaccurate, especially on machines with the kernel timer tick set at 100Hz"
      Closes #2592
      See merge request isc-projects/bind9!4826
    • Evan Hunt's avatar
      CHANGES · 1933bcf1
      Evan Hunt authored
    • Patrick McLean's avatar
      dig: Use high resolution clocks when microsecond accuracy is requested · 56cef149
      Patrick McLean authored
      The TIME_NOW macro calls isc_time_now which uses CLOCK_REALTIME_COARSE
      for getting the current time. This is perfectly fine for millisecond,
      however when the user request microsecond resolutiuon, they are going
      to get very inaccurate results. This is especially true on a server
      class machine where the clock ticks may be set to 100HZ.
      This changes dig to use the new TIME_NOW_HIRES macro that uses the
      CLOCK_MONOTONIC_RAW that is more expensive, but gets the *actual*
      current time rather than the at the last kernel time tick.
    • Patrick McLean's avatar
      Add isc_time_now_hires function to get current time with high resolution · ebced74b
      Patrick McLean authored
      The current isc_time_now uses CLOCK_REALTIME_COARSE which only updates
      on a timer tick. This clock is generally fine for millisecond accuracy,
      but on servers with 100hz clocks, this clock is nowhere near accurate
      enough for microsecond accuracy.
      This commit adds a new isc_time_now_hires function that uses
      CLOCK_REALTIME, which gives the current time, though it is somewhat
      expensive to call. When microsecond accuracy is required, it may be
      required to use extra resources for higher accuracy.
  2. 19 Mar, 2021 9 commits
    • Ondřej Surý's avatar
      Merge branch '2416-improve-netmgr-unit-tests-reliability' into 'main' · bee4ee93
      Ondřej Surý authored
      Improve reliability of the netmgr unit tests
      Closes #2455 and #2416
      See merge request isc-projects/bind9!4628
    • Ondřej Surý's avatar
      Require CMocka >= 1.1.3 to run the unit tests · d96c94d7
      Ondřej Surý authored
      In CMocka versions << 1.1.3, the skip() function would cause the whole
      unit test to abort when CMOCKA_TEST_ABORT is set.  As this is problem
      only in Debian 9 Stretch and Ubuntu 16.04 Xenial, we just require the
      CMocka >= 1.1.3 and disable the unit testing on Debian 9 Stretch until
      we can pull the libcmocka-dev from stretch-backports and remove the
      Ubuntu 16.04 Xenial from the CI as it is reaching End of Standard
      Support at the end of April 2021.
    • Ondřej Surý's avatar
      Fix compilation with NETMGR_TRACE(_VERBOSE) enabled on non-Linux · d016ea74
      Ondřej Surý authored
      When NETMGR_TRACE(_VERBOSE) is enabled, the build would fail on some
      non-Linux non-glibc platforms because:
        * Use <stdint.h> print macros because uint_fast32_t is not always
          unsigned long
        * The header <execinfo.h> is not available on non-glibc, thus commit
          adds dummy backtrace() and backtrace_symbols_fd() functions for
          platforms without HAVE_BACKTRACE
    • Ondřej Surý's avatar
      Improve reliability of the netmgr unit tests · 42e4e3b8
      Ondřej Surý authored
      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.
    • Ondřej Surý's avatar
      Merge branch 'ondrej/call-failed_read-from-tls_error' into 'main' · e8cd3d3c
      Ondřej Surý authored
      Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket
      See merge request isc-projects/bind9!4824
    • Ondřej Surý's avatar
      Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket · e4e0e9e3
      Ondřej Surý authored
      In tls_error(), we now call isc__nm_tlsdns_failed_read() instead of just
      stopping timer and reading from the socket.  This allows us to properly
      cleanup any pending operation on the socket.
    • Matthijs Mekking's avatar
      Merge branch 'treysis-filter-a' into 'main' · 085c2e32
      Matthijs Mekking authored
      filter-a plugin
      Closes #2585
      See merge request isc-projects/bind9!4816
    • Matthijs Mekking's avatar
      Add changes for filter-a plugin · 9a256347
      Matthijs Mekking authored
    • treysis's avatar
      Add filter-a plugin for IPv6-dominant environments · 6b2ea006
      treysis authored
      (cherry picked from commit 78f6cd57)
  3. 18 Mar, 2021 25 commits
  4. 17 Mar, 2021 2 commits