]> granicus.if.org Git - python/commitdiff
bpo-30830: logging.config.listen() calls server_close() (#3524)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 13 Sep 2017 08:44:08 +0000 (01:44 -0700)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2017 08:44:08 +0000 (01:44 -0700)
The ConfigSocketReceiver.serve_until_stopped() method from
logging.config.listen() now calls server_close() (of
socketserver.ThreadingTCPServer) rather than closing manually the
socket.

While this change has no effect yet, it will help to prevent dangling
threads once ThreadingTCPServer.server_close() will join spawned
threads (bpo-31233).

Lib/logging/config.py

index c16a75a0f1edfa4bd62da3d1f05a6a4648b557a9..b08cba0687563d65f8c704c066b11c5f4ca2f327 100644 (file)
@@ -887,7 +887,7 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None):
                 logging._acquireLock()
                 abort = self.abort
                 logging._releaseLock()
-            self.socket.close()
+            self.server_close()
 
     class Server(threading.Thread):