diff --git a/dnstap/dtstream.c b/dnstap/dtstream.c index dda3ef1ff..7c8a08604 100644 --- a/dnstap/dtstream.c +++ b/dnstap/dtstream.c @@ -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)) { diff --git a/doc/Changelog b/doc/Changelog index de643c8b1..1923c17ad 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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).