When a query times out, and
host) creates a new query
to resend the request, it is being prepended to the lookup's queries
list, which can cause a confusion later, making
believe that there is another new query in the list, but that is
actually the old one, which was timed out. That mistake will result
in an assertion failure.
That can happen, in particular, when after a timed out request,
the retried request returns a SERVFAIL result, and the recursion
is enabled, and
+nofail option was used with
dig (that is the
default behavior in
host, unless the
-s option is provided).
Fix the problem by inserting the query just after the current, timed-out query, instead of prepending to the list.
Closes #3020 (closed)