diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-08-11 18:24:10 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-08-11 18:28:29 +0200 |
commit | 3716ea5afe9ccf853cdea838f0217f7bf5413676 (patch) | |
tree | a9c1d1c667b80457f11da962f32c2958032b265e /lib | |
parent | 1e9a3ae7f0093c2faf515268a3d178a7891984ff (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.py | 2 |
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?)://([^/]+)(.*)') |