New submission from Aviv Palivoda: Currently if you call server_close you only close the socket. If we called serve_forever and then call server_close without calling shutdown the serve_forever loop keep running. Before using the selectors module for doing the poll we would have had exception thrown from the select (The socket fd is -1) in serve_forever. IMO you should be able to call server_close at any time and expect it to stop the serve_forever. Maybe even adding a block option to server_close that will wait on the server_forever if it's running (waiting for issue 12463 to resolve before doing this). Added a patch that closes serve_forever if server_close is called.
---------- components: Library (Lib) files: socketserver_close_stop_serve_forever.patch keywords: patch messages: 260524 nosy: palaviv priority: normal severity: normal status: open title: socketserver.BaseServer.close_server should stop serve_forever versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41971/socketserver_close_stop_serve_forever.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26392> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com