From ccf05d0f258c7f158b0436f11137702ee78d4ddb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Dec 2016 18:45:48 +0000 Subject: [PATCH] consistency check: Tolerate done children on intdone This can happen temporarily (for example, during globalsystemfailure or during adns__query_fail's recursion through queries). There is no problem unless it persists as we leave adns. Signed-off-by: Ian Jackson --- src/check.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/check.c b/src/check.c index fcf1995..c773508 100644 --- a/src/check.c +++ b/src/check.c @@ -136,14 +136,19 @@ static void checkc_queue_tcpw(adns_state ads) { } static void checkc_queue_childw(adns_state ads) { - adns_query parent, child; + adns_query parent, child, search; DLIST_CHECK(ads->childw, parent, , { assert(parent->state == query_childw); assert(parent->children.head); DLIST_CHECK(parent->children, child, siblings., { assert(child->parent == parent); - assert(child->state != query_done); + if (child->state == query_done) { + for (search= ads->intdone.head; search; search= search->next) + if (search==child) goto child_done_ok; + assert(!"done child not on intdone"); + child_done_ok:; + } }); checkc_query(ads,parent); checkc_query_alloc(ads,parent); -- 2.30.2