]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/udp_queue: drop the error logging
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 12 Feb 2021 09:06:25 +0000 (10:06 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 12 Feb 2021 10:12:42 +0000 (11:12 +0100)
We should do this for all transports and probably just in verbose mode.
We were printing lots of these on Turris OS (for one user at least):
https://forum.turris.cz/t/5-1-8-kresd-throwing-many-errors-in-var-log-messages/14775

EACCESS in particular apparently may happen (on Linux) when the network
is "unavailable", EPERM because of firewall/netfilter:
https://stackoverflow.com/a/23869102

NEWS
daemon/udp_queue.c

diff --git a/NEWS b/NEWS
index bb584f9a0ee18d1dc60ad6e7c7984726bc4e72f5..d8431c031719c6fc28c9f2bd15eea044aa5d86cc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Improvements
 - daf module: add daf.clear() (!1114)
 - dnstap module: more features and don't log internal requests (!1103)
 - randomize record order by default, i.e. reorder_RR(true) (!1123)
+- avoid excessive logging of UDP replies with sendmmsg (!1138)
 
 Bugfixes
 --------
index 9cf39401a39c8b4f4816090c9c4edf4e20920b15..4d2f27ae9758956b000a90382b8dd974e316af53 100644 (file)
@@ -76,19 +76,6 @@ static void udp_queue_send(int fd)
        int sent_len = sendmmsg(fd, q->msgvec, q->len, 0);
        /* ATM we don't really do anything about failures. */
        int err = sent_len < 0 ? errno : EAGAIN /* unknown error, really */;
-       if (unlikely(sent_len != q->len)) {
-               if (err != EWOULDBLOCK) {
-                       kr_log_error("ERROR: udp sendmmsg() sent %d / %d; %s\n",
-                                       sent_len, q->len, strerror(err));
-               } else {
-                       const uint64_t stamp_now = kr_now();
-                       static uint64_t stamp_last = 0;
-                       if (stamp_now > stamp_last + 60*1000) {
-                               kr_log_info("WARNING: dropped UDP reply packet(s) due to network overload (reported at most once per minute)\n");
-                               stamp_last = stamp_now;
-                       }
-               }
-       }
        for (int i = 0; i < q->len; ++i) {
                qr_task_on_send(q->items[i].task, NULL, i < sent_len ? 0 : err);
                worker_task_unref(q->items[i].task);