Bug 1498782 - Skip thread shutdown in nsHostResolver if there are still active threads after a delay r=bagder
☠☠ backed out by 86474265d163 ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 17 Oct 2018 06:24:39 +0000
changeset 497336 a4b43a47589a481f19fd60184881ed5d8caddd73
parent 497335 8d8ed5f447d03c13e0503c6fa4d113116817fd21
child 497391 bff7126ddd3fbe19e3468b4c6896b45cf636582e
push id9996
push userarchaeopteryx@coole-files.de
push dateThu, 18 Oct 2018 18:37:15 +0000
treeherdermozilla-beta@8efe26839243 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs1498782
milestone64.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 1498782 - Skip thread shutdown in nsHostResolver if there are still active threads after a delay r=bagder Differential Revision: https://phabricator.services.mozilla.com/D8725
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -865,17 +865,22 @@ nsHostResolver::Shutdown()
 #endif
 
     {
         mozilla::DebugOnly<nsresult> rv = GetAddrInfoShutdown();
         NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
                              "Failed to shutdown GetAddrInfo");
     }
 
-    mResolverThreads->Shutdown();
+    // It is possible that there are still threads waiting on a very slow DNS
+    // query. In that case, it's better just to skip the thread shutdown,
+    // or we might trigger the shutdownhang reporter.
+    if (mActiveTaskCount == 0) {
+        mResolverThreads->Shutdown();
+    }
 }
 
 nsresult
 nsHostResolver::GetHostRecord(const nsACString &host, uint16_t type,
                               uint16_t flags, uint16_t af, bool pb,
                               const nsCString &originSuffix,
                               nsHostRecord **result)
 {