bug 807441 increase stickiness of dns choices r=josh
authorPatrick McManus <mcmanus@ducksong.com>
Thu, 20 Dec 2012 15:51:11 -0500
changeset 125814 72d7159b813b79a0337fb29a5365c2ba2262037a
parent 125813 40822fe6962b2cf4b1424b90daf94cf5ca649501
child 125815 6fe383b92b05fd5e6134f207c04ecf2045f301ee
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh
bugs807441
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 807441 increase stickiness of dns choices r=josh
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -530,20 +530,21 @@ nsHostResolver::ResolveHost(const char  
                      he->rec->HasResult() &&
                      NowInMinutes() <= he->rec->expiration + mGracePeriod) {
                         
                 LOG(("Using cached record for host [%s].\n", host));
                 // put reference to host record on stack...
                 result = he->rec;
                 Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, METHOD_HIT);
 
-                // For entries that are in the grace period, or all cached
-                // negative entries, use the cache but start a new lookup in
+                // For entries that are in the grace period with a failed connect,
+                // or all cached negative entries, use the cache but start a new lookup in
                 // the background
-                if (((NowInMinutes() > he->rec->expiration) ||
+                if ((((NowInMinutes() > he->rec->expiration) &&
+                      he->rec->mBlacklistedItems.Length()) ||
                      he->rec->negative) && !he->rec->resolving) {
                     LOG(("Using %s cache entry for host [%s] but starting async renewal.",
                          he->rec->negative ? "negative" :"positive", host));
                     IssueLookup(he->rec);
 
                     if (!he->rec->negative) {
                         // negative entries are constantly being refreshed, only
                         // track positive grace period induced renewals