We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef36e1c commit 51de8baCopy full SHA for 51de8ba
prometheus_client/exposition.py
@@ -173,6 +173,11 @@ def factory(cls, registry):
173
174
class _ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
175
"""Thread per request HTTP server."""
176
+ # Make worker threads "fire and forget". Beginning with Python 3.7 this
177
+ # prevents a memory leak because ``ThreadingMixIn`` starts to gather all
178
+ # non-daemon threads in a list in order to join on them at server close.
179
+ # Enabling daemon threads virtually makes ``_ThreadingSimpleServer`` the
180
+ # same as Python 3.7's ``ThreadingHTTPServer``.
181
daemon_threads = True
182
183
0 commit comments