summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2020-08-11 18:24:10 +0200
committerEmilio Pozuelo Monfort <pochu@debian.org>2020-08-11 18:28:29 +0200
commit6ee5cd6be5a18a1753aabfaa10ead6d3f6c8a9c5 (patch)
treea0fa0f2769efd8ed3ed5a05a9e5c47db3cdac7e5 /lib
parent12a574a1e5d4f7e82975e8d6a23a7d1e27085bc5 (diff)
web_support: fix memory leak with Python 3
ThreadingMixIn keeps a list of all non-deamon threads since Python 3.7, which prevents all the resources from being freed. Daemonize them so that we don't keep their resources forever, eventually causing OOM.
Diffstat (limited to 'lib')
-rw-r--r--lib/python/web_support.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py
index 5b06d7743a..9c73ef5796 100644
--- a/lib/python/web_support.py
+++ b/lib/python/web_support.py
@@ -796,7 +796,7 @@ class WebService(Service, WebServiceBase):
r.flatten(result.write)
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
- pass
+ daemon_threads = True
RE_BASE_URL = re.compile(r'^(https?)://([^/]+)(.*)')

© 2014-2024 Faster IT GmbH | imprint | privacy policy