]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for #882: small changes, date updated in Copyright for
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 26 Apr 2023 11:49:33 +0000 (13:49 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 26 Apr 2023 11:49:33 +0000 (13:49 +0200)
  util/timeval_func.c and util/timeval_func.h. Man page entries and
  example entry.

doc/Changelog
doc/example.conf.in
doc/unbound-control.8.in
doc/unbound.conf.5.in
util/timeval_func.c
util/timeval_func.h

index a5fb8460e9af03f86431d80ae6921d99047ef669..4371e3044ed06b7d0798a9372bd448cbcdf74986 100644 (file)
@@ -1,3 +1,12 @@
+26 April 2023: Wouter
+       - Merge #882 from vvfedorenko: Features/dropqueuedpackets, with
+         sock-queue-timeout option that drops packets that have been in the
+         socket queue for too long. Added statistics num.queries_timed_out
+         and query.queue_time_us.max that track the socket queue timeouts.
+       - Fix for #882: small changes, date updated in Copyright for
+         util/timeval_func.c and util/timeval_func.h. Man page entries and
+         example entry.
+
 19 April 2023: Wouter
        - Fix for #878: Invalid IP address in unbound.conf causes Segmentation
          Fault on OpenBSD.
index 5b7517052cda5756b9862d05d7d875429a0b7406..0523bc75672a49e48eed2d96a294c19a24e2154e 100644 (file)
@@ -274,6 +274,10 @@ server:
        # Timeout for EDNS TCP keepalive, in msec.
        # edns-tcp-keepalive-timeout: 120000
 
+       # UDP queries that have waited in the socket buffer for a long time
+       # can be dropped. Default is 0, disabled. In seconds, such as 3.
+       # sock-queue-timeout: 0
+
        # Use systemd socket activation for UDP, TCP, and control sockets.
        # use-systemd: no
 
index 18bfd44d853b292f3bb742231121f5d98b3bfae9..8ab2214563252e5521ff79e263de0ae33cf70fef 100644 (file)
@@ -398,6 +398,14 @@ as a cache response was sent.
 .I threadX.num.expired
 number of replies that served an expired cache entry.
 .TP
+.I threadX.num.queries_timed_out
+number of queries that are dropped because they waited in the UDP socket buffer
+for too long.
+.TP
+.I threadX.query.queue_time_us.max
+The maximum wait time for packets in the socket buffer, in microseconds. This
+is only reported when sock-queue-timeout is enabled.
+.TP
 .I threadX.num.recursivereplies
 The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries.
 .TP
@@ -462,6 +470,12 @@ summed over threads.
 .I total.num.expired
 summed over threads.
 .TP
+.I total.num.queries_timed_out
+summed over threads.
+.TP
+.I total.query.queue_time_us.max
+the maximum of the thread values.
+.TP
 .I total.num.recursivereplies
 summed over threads.
 .TP
index 79039d58e4918f7cf7d1e0e2a0f80bcf6d294c95..33c15e2827fe32554c2039a7e820ac79b8f51ca9 100644 (file)
@@ -505,6 +505,14 @@ configured, and finally to 0 if the number of free buffers falls below
 A minimum actual timeout of 200 milliseconds is observed regardless of the
 advertised timeout.
 .TP
+.B sock\-queue\-timeout: \fI<sec>\fR
+UDP queries that have waited in the socket buffer for a long time can be
+dropped. Default is 0, disabled. The time is set in seconds, 3 could be a
+good value to ignore old queries that likely the client does not need a reply
+for any more. This could happen if the host has not been able to service
+the queries for a while, i.e. Unbound is not running, and then is enabled
+again. It uses timestamp socket options.
+.TP
 .B tcp\-upstream: \fI<yes or no>
 Enable or disable whether the upstream queries use TCP only for transport.
 Default is no.  Useful in tunneling scenarios. If set to no you can specify
index 83e963dc89f8342cb1b3ff06f1be8c8d6a60933f..90250e153d90e6410b9b9635cf524efbbafa4c47 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * util/timeval_func.c - helpers to work with struct timeval values.
  *
- * Copyright (c) 2007, NLnet Labs. All rights reserved.
+ * Copyright (c) 2023, NLnet Labs. All rights reserved.
  *
  * This software is open source.
  *
@@ -39,6 +39,7 @@
  * This file contains helpers to manipulate struct timeval values.
  */
 
+#include "config.h"
 #include "timeval_func.h"
 
 /** subtract timers and the values do not overflow or become negative */
index afc35c7e95e6b554d02cfc27d4cff5100e1259c8..819d1dd80fb7bae688b9ee41be673ec16c016ad0 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * util/timeval)func.h - definitions of helpers for strcut timeval values.
+ * util/timeval_func.h - definitions of helpers for struct timeval values.
  *
- * Copyright (c) 2007, NLnet Labs. All rights reserved.
+ * Copyright (c) 2023, NLnet Labs. All rights reserved.
  *
  * This software is open source.
  *