commit 5026f38e37fa46e05fa72dc64ac4d91d51232748
parent 4775083d6587de3f5780850f2a5628f0debcb2bd
Author: Valentin Gosu <valentin.gosu@gmail.com>
Date: Wed, 5 Nov 2025 08:23:20 +0000
Bug 1896255 - Increase default timeout to shutdown DNS threads to 5 seconds r=necko-reviewers,jesup
The timeout is meant to avoid hanging forever during shutdown.
The increased frequency of shutdown leaks means we're often leaking this on
Linux. The previous 2 second timeout might have been a little too eager.
This should achieve the same thing while being whithin the 5 second default
timeout of DNS requests on linux (not counting retries).
See https://man7.org/linux/man-pages/man5/resolv.conf.5.html
Differential Revision: https://phabricator.services.mozilla.com/D271192
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
@@ -14248,7 +14248,7 @@
# Max time to shutdown the resolver threads
- name: network.dns.resolver_shutdown_timeout_ms
type: uint32_t
- value: 2000
+ value: 5000
mirror: always
# When true on Windows DNS resolutions for single label domains
diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp
@@ -337,7 +337,7 @@ void nsHostResolver::Shutdown() {
mNCS = nullptr;
}
- // Shutdown the resolver threads, but with a timeout of 2 seconds (prefable).
+ // Shutdown the resolver threads, but with a timeout of 5 seconds (prefable).
// If the timeout is exceeded, any stuck threads will be leaked.
mResolverThreads->ShutdownWithTimeout(
StaticPrefs::network_dns_resolver_shutdown_timeout_ms());