]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that dnstap reconnects do not spam the log with the repeated
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Aug 2020 07:23:36 +0000 (09:23 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Aug 2020 07:23:36 +0000 (09:23 +0200)
  attempts.  Attempts on the timer are only logged on high verbosity,
  if they produce a connection failure error.

dnstap/dtstream.c
doc/Changelog

index dda3ef1ff485e74840c5050c23d46fe1ed047b50..7c8a08604a38b5eef36ab8a3d52ef83a2c02ad50 100644 (file)
@@ -1873,6 +1873,11 @@ static int dtio_open_output_local(struct dt_io_thread* dtio)
        if(connect(dtio->fd, (struct sockaddr*)&s, (socklen_t)sizeof(s))
                == -1) {
                char* to = dtio->socket_path;
+               if(dtio->reconnect_timeout > DTIO_RECONNECT_TIMEOUT_MIN &&
+                       verbosity < 4) {
+                       dtio_close_fd(dtio);
+                       return 0; /* no log retries on low verbosity */
+               }
 #ifndef USE_WINSOCK
                log_err("dnstap io: failed to connect to \"%s\": %s",
                        to, strerror(errno));
@@ -1916,6 +1921,11 @@ static int dtio_open_output_tcp(struct dt_io_thread* dtio)
        if(connect(dtio->fd, (struct sockaddr*)&addr, addrlen) == -1) {
                if(errno == EINPROGRESS)
                        return 1; /* wait until connect done*/
+               if(dtio->reconnect_timeout > DTIO_RECONNECT_TIMEOUT_MIN &&
+                       verbosity < 4) {
+                       dtio_close_fd(dtio);
+                       return 0; /* no log retries on low verbosity */
+               }
 #ifndef USE_WINSOCK
                if(tcp_connect_errno_needs_log(
                        (struct sockaddr *)&addr, addrlen)) {
index de643c8b1d6ee697a5d1d09b4aa9a38aa8c7a1ef..1923c17ad22bda378249caa9723063ecbc08cad8 100644 (file)
@@ -1,3 +1,8 @@
+24 August 2020: Wouter
+       - Fix that dnstap reconnects do not spam the log with the repeated
+         attempts.  Attempts on the timer are only logged on high verbosity,
+         if they produce a connection failure error.
+
 20 August 2020: Ralph
        - Fix stats double count issue (#289).