Fix memory leak on python 3.7 (#1200)

Close https://github.com/zalando/patroni/issues/1167
This commit is contained in:
Alexander Kukushkin
2019-10-07 10:55:26 +02:00
committed by GitHub
parent ee678f61d7
commit 686b2c5432
+2
View File
@@ -492,6 +492,8 @@ class RestApiHandler(BaseHTTPRequestHandler):
class RestApiServer(ThreadingMixIn, HTTPServer, Thread):
# On 3.7+ the `ThreadingMixIn` gathers all non-daemon worker threads in order to join on them at server close.
daemon_threads = True # Make worker threads "fire and forget" to prevent a memory leak.
def __init__(self, patroni, config):
self.patroni = patroni