From: W.C.A. Wijngaards Date: Wed, 12 Nov 2025 10:49:04 +0000 (+0100) Subject: - Fix that when discard timeout drops packet, they are accounted as X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a15118aff26d906ef078295877d55069f368f44;p=thirdparty%2Funbound.git - Fix that when discard timeout drops packet, they are accounted as less reply addresses in use in the mesh area. --- diff --git a/doc/Changelog b/doc/Changelog index a6f5e9e5a..0350b5358 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 diff --git a/services/mesh.c b/services/mesh.c index af2172102..ca622e9c9 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -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) { diff --git a/testdata/stat_values.tdir/stat_values.test b/testdata/stat_values.tdir/stat_values.test index 7dd71edd6..9156f95a9 100644 --- a/testdata/stat_values.tdir/stat_values.test +++ b/testdata/stat_values.tdir/stat_values.test @@ -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