diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index f219e16bbfd..89968f6ca03 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1109,11 +1109,20 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e) } EThread *thread = mutex->thread_holding; if (event != DNS_EVENT_LOOKUP) { - // This was an event_interval or an event_immediate - // Either we timed out, or remove_trigger_pending gave up on us + // Event should be immediate or interval. if (!action.continuation) { - // give up on insert, it has been too long - hostDB.pending_dns_for_hash(hash.hash).remove(this); + // Nothing to do, give up. + if (event == EVENT_INTERVAL) { + // Timeout - clear all queries queued up for this FQDN because none of the other ones have sent an + // actual DNS query. If the request rate is high enough this can cause a persistent queue where the + // DNS query is never sent and all requests timeout, even if it was a transient error. + // See issue #8417. + remove_trigger_pending_dns(); + } else { + // "local" signal to give up, usually due this being one of those "other" queries. + // That generally means @a this has already been removed from the queue, but just in case... + hostDB.pending_dns_for_hash(hash.hash).remove(this); + } hostdb_cont_free(this); return EVENT_DONE; }