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 | a7e0838bded1fd48e1c1ff2c2e55012794d2f280 (patch) | |
tree | 97fb733f54241d2eb284eba59fb0e7f5c87b111e /lib | |
parent | a6c3280e21ef4efc58c2a25d9ebc98507d7fe863 (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?)://([^/]+)(.*)') |