From 6ee5cd6be5a18a1753aabfaa10ead6d3f6c8a9c5 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Tue, 11 Aug 2020 18:24:10 +0200 Subject: 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. --- lib/python/web_support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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?)://([^/]+)(.*)') -- cgit v1.2.3