]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that when discard timeout drops packet, they are accounted as
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 12 Nov 2025 10:49:04 +0000 (11:49 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 12 Nov 2025 10:49:04 +0000 (11:49 +0100)
  less reply addresses in use in the mesh area.

doc/Changelog
services/mesh.c
testdata/stat_values.tdir/stat_values.test

index a6f5e9e5ac8b56a5a255a909685d5d98cb56ccf1..0350b53589e8288176fba398f0b6488fd043a257 100644 (file)
@@ -1,3 +1,7 @@
+12 November 2025: Wouter
+       - Fix that when discard timeout drops packet, they are accounted as
+         less reply addresses in use in the mesh area.
+
 6 November 2025: Wouter
        - Fix add comment to worker_handle_request function that explain it.
        - Fix configure test for noreturn attribute so it compiles without
index af217210207e7c9e156ef7a736fe763ce2c4c7df..ca622e9c9232a8124534edb26252122cc533fe25 100644 (file)
@@ -1765,6 +1765,8 @@ void mesh_query_done(struct mesh_state* mstate)
                                        http2_stream_remove_mesh_state(r->h2_stream);
                                comm_point_drop_reply(&r->query_reply);
                                mstate->reply_list = reply_list;
+                               log_assert(mstate->s.env->mesh->num_reply_addrs > 0);
+                               mstate->s.env->mesh->num_reply_addrs--;
                                mstate->s.env->mesh->num_queries_discard_timeout++;
                                continue;
                        }
@@ -1801,6 +1803,8 @@ void mesh_query_done(struct mesh_state* mstate)
                        }
                        comm_point_drop_reply(&r->query_reply);
                        mstate->reply_list = reply_list;
+                       log_assert(mstate->s.env->mesh->num_reply_addrs > 0);
+                       mstate->s.env->mesh->num_reply_addrs--;
                } else {
                        struct sldns_buffer* r_buffer = r->query_reply.c->buffer;
                        if(r->query_reply.c->tcp_req_info) {
index 7dd71edd6b3b2b1c9e57e51b8282d7e6cbba0bea..9156f95a97160eadda3548db9691bd5c6c78caaa 100644 (file)
@@ -468,8 +468,10 @@ bring_up_alternate_configuration ub_discard_wait_limit.conf
 teststep "Check discard-timeout and wait-limit"
 echo "> dig www.unresponsive"
 dig @127.0.0.1 -p $UNBOUND_PORT +retry=2 +timeout=1 www.unresponsive. | tee outfile
-echo "> check answer"
-if grep "no servers could be reached" outfile; then
+# Wait for nonresponse servfail, that causes discards.
+sleep 2
+if grep "no servers could be reached" outfile ||
+       grep "Too many queries queued up and waiting" outfile; then
        echo "OK"
 else
        end 1