Skip to content

Commit bfd5f89

Browse files
Update HostDBContinuation timeout handling to clear pending queue. (#8480)
Closes #8417
1 parent 1f5e583 commit bfd5f89

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

iocore/hostdb/HostDB.cc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,20 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
11091109
}
11101110
EThread *thread = mutex->thread_holding;
11111111
if (event != DNS_EVENT_LOOKUP) {
1112-
// This was an event_interval or an event_immediate
1113-
// Either we timed out, or remove_trigger_pending gave up on us
1112+
// Event should be immediate or interval.
11141113
if (!action.continuation) {
1115-
// give up on insert, it has been too long
1116-
hostDB.pending_dns_for_hash(hash.hash).remove(this);
1114+
// Nothing to do, give up.
1115+
if (event == EVENT_INTERVAL) {
1116+
// Timeout - clear all queries queued up for this FQDN because none of the other ones have sent an
1117+
// actual DNS query. If the request rate is high enough this can cause a persistent queue where the
1118+
// DNS query is never sent and all requests timeout, even if it was a transient error.
1119+
// See issue #8417.
1120+
remove_trigger_pending_dns();
1121+
} else {
1122+
// "local" signal to give up, usually due this being one of those "other" queries.
1123+
// That generally means @a this has already been removed from the queue, but just in case...
1124+
hostDB.pending_dns_for_hash(hash.hash).remove(this);
1125+
}
11171126
hostdb_cont_free(this);
11181127
return EVENT_DONE;
11191128
}

0 commit comments

Comments
 (0)