1. 21 Jun, 2020 1 commit
    • Tony Finch's avatar
      Expose each zone's last refresh time via rndc and the stats channel · 3429cd8f
      Tony Finch authored
      When a zone is refreshed its file is touched by `named`, so checking
      the modification time is a good way to verify that refreshes are
      working correctly. The last refresh time is good for this purpose
      since it can give the operator a reasonably prompt notification that
      somthing has broken with plenty of time to remediate, e.g. 24h after
      a zone stops updating is typically several days before the zone will
      break. If you try to alert based on the expiry time you either need to
      accommodate different expiry intervals in different zones (which is
      duplicating logic that already exists inside `named`), or set the
      alert to occur much closer to the time when a zone will break.
      This patch adds the last refresh time alongside the other zone timing
      parameters in the output of `rndc zonestatus` and the statschannel.
      In servers that have a static configuration, `named-checkconf -px` is
      a handy way for a script to find out what zones are configured and
      where their files are, so that they can be checked for freshness. In a
      server with a dynamic configuration, using `rndc addzone` or catalog
      zones, the best way to get a list of zones is from the statschannel.
      This change gives monitoring scripts a simple one-stop shop for
      checking that all zones are reasonably fresh, for example,
      	curl -Ssf http://localhost:8053/json/v1/zones |
      	jq -r '.views[].zones[] |
      		select(has("last_refresh") and
      			.last_refresh < (now - 86400 | todate)) |
      		"\(.last_refresh) \(.name)"'
  2. 19 Jun, 2020 11 commits
    • Evan Hunt's avatar
      Merge branch 'each-rndc-netmgr-pt1' into 'main' · 5238433f
      Evan Hunt authored
      client-side TCP
      Closes #1958
      See merge request isc-projects/bind9!3723
    • Evan Hunt's avatar
      CHANGES · 8b9e2d33
      Evan Hunt authored
    • Evan Hunt's avatar
      change the signature of recv callbacks to include a result code · 75c985c0
      Evan Hunt authored
      this will allow recv event handlers to distinguish between cases
      in which the region is NULL because of error, shutdown, or cancelation.
    • Evan Hunt's avatar
      implement isc_nm_cancelread() · 5191ec8f
      Evan Hunt authored
      The isc_nm_cancelread() function cancels reading on a connected
      socket and calls its read callback function with a 'result'
      parameter of ISC_R_CANCELED.
    • Evan Hunt's avatar
      shorten the sleep in isc_nm_destroy() · 870204fe
      Evan Hunt authored
      when isc_nm_destroy() is called, there's a loop that waits for
      other references to be detached, pausing and unpausing the netmgr
      to ensure that all the workers' events are run, followed by a
      1-second sleep. this caused a delay on shutdown which will be
      noticeable when netmgr is used in tools other than named itself,
      so the delay has now been reduced to a hundredth of a second.
    • Evan Hunt's avatar
      implement isc_nm_tcpconnect() · abbb79f9
      Evan Hunt authored
      the isc_nm_tcpconnect() function establishes a client connection via
      TCP.  once the connection is esablished, a callback function will be
      called with a newly created network manager handle.
    • Witold Krecicki's avatar
      allow tcpdns sockets to self-reference while connected · cd79b495
      Witold Krecicki authored
      A TCPDNS socket creates a handle for each complete DNS message.
      Previously, when all the handles were disconnected, the socket
      would be closed, but the wrapped TCP socket might still have
      more to read.
      Now, when a connection is established, the TCPDNS socket creates
      a reference to itself by attaching itself to sock->self. This
      reference isn't cleared until the connection is closed via
      EOF, timeout, or server shutdown. This allows the socket to remain
      open even when there are no active handles for it.
    • Evan Hunt's avatar
      modify reference counting within netmgr · 5ea26ee1
      Evan Hunt authored
      - isc__nmhandle_get() now attaches to the sock in the nmhandle object.
        the caller is responsible for dereferencing the original socket
        pointer when necessary.
      - tcpdns listener sockets attach sock->outer to the outer tcp listener
        socket. tcpdns connected sockets attach sock->outerhandle to the handle
        for the tcp connected socket.
      - only listener sockets need to be attached/detached directly. connected
        sockets should only be accessed and reference-counted via their
        associated handles.
    • Evan Hunt's avatar
      make isc_nmsocket_{attach,detach}{} functions private · 9e740cad
      Evan Hunt authored
      there is no need for a caller to reference-count socket objects.
      they need tto be able tto close listener sockets (i.e., those
      returned by isc_nm_listen{udp,tcp,tcpdns}), and an isc_nmsocket_close()
      function has been added for that. other sockets are only accessed via
    • Mark Andrews's avatar
      Merge branch 'marka-placeholder' into 'main' · be032d64
      Mark Andrews authored
      placeholder for [GL #1955]
      See merge request isc-projects/bind9!3720
    • Mark Andrews's avatar
      placeholder for [GL #1955] · 642279dd
      Mark Andrews authored
  3. 18 Jun, 2020 28 commits