summaryrefslogtreecommitdiffstats
path: root/Lib/socketserver.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37193: Remove thread objects which finished process its request (GH-23127)Jason R. Coombs2020-12-311-12/+39
| | | This reverts commit aca67da4fe68d5420401ac1782203d302875eb27.
* Revert "bpo-37193: remove thread objects which finished process its request ↵Jason R. Coombs2020-11-021-60/+13
| | | | | (GH-13893)" (GH-23107) This reverts commit c41559021213cfc9dc62a83fc63306b3bdc3e64b.
* bpo-37193: remove thread objects which finished process its request (GH-13893)MARUYAMA Norihiro2020-11-011-13/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-37193: remove the thread which finished process request from threads list * rename variable t to thread. * don't remove thread from list if it is daemon. * use lock to protect self._threads. * use finally block in case of exception from shutdown_request(). * check "not thread.daemon" before lock to avoid holding the lock if it's unnecessary. * fix the place of _threads_lock. * separate code to remove a current thread into a function. * check ValueError when removing thread. * fix wrong code which all instance shared same lock. * Extract thread management into a _Threads class to encapsulate atomic operations and separate concerns. * Replace multiple references of 'block_on_close' with one, avoiding the possibility that 'block_on_close' could change during the course of processing requests. Now, there's exactly one _threads object with behavior fixed for the duration. * Add docstrings to private classes. * Add test to ensure that a ThreadingTCPServer can be closed without serving any requests. * Use _NoThreads as the default value. Fixes AttributeError when server is closed without serving any requests. * Add blurb * Add test capturing failure. Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* Change 'exception happened' to 'exception occurred' in two places (#19767)Noah Doersing2020-05-011-1/+1
|
* Fix typo in Lib/socketserver.py (GH-17024)Jason (Perry) Taylor2019-11-161-1/+1
| | | | changed 'This is bad class design, but save some typing' into 'This is bad class design, but saves some typing'.
* Fix typo in socketserver docstring (GH-11252)Christopher Hunt2018-12-211-1/+1
| | | | Fix typo in the docstring of `service_actions`. serve_forver -> serve_forever
* bpo-35017, socketserver: don't accept request after shutdown (GH-9952)Denis Ledoux2018-10-261-0/+3
| | | | | | | | | | | | | | Prior to this revision, after the shutdown of a `BaseServer`, the server accepted a last single request if it was sent between the server socket polling and the polling timeout. This can be problematic for instance for a server restart for which you do not want to interrupt the service, by not closing the listening socket during the restart. One request failed because of this behavior. Note that only one request failed, following requests were not accepted, as expected.
* bpo-33540: Fix socketserver.ThreadingMixIn if block_on_close=False (GH-7310)Victor Stinner2018-06-011-1/+1
| | | | socketserver.ThreadingMixIn no longer tracks active threads if block_on_close is false.
* bpo-33540: Add block_on_close attr to socketserver (GH-6911)Victor Stinner2018-05-241-6/+11
| | | | Add a new block_on_close class attribute to ForkingMixIn and ThreadingMixIn classes of socketserver to opt-in for pre-3.7 behaviour.
* bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)Victor Stinner2017-09-131-0/+15
| | | | | | | | | socketserver.ThreadingMixIn now keeps a list of non-daemonic threads to wait until all these threads complete in server_close(). Reenable test_logging skipped tests. Fix SocketHandlerTest.tearDown(): close the socket handler before stopping the server, so the server can join threads.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-4/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31151: Add socketserver.ForkingMixIn.server_close() (#3057)Victor Stinner2017-08-101-2/+7
| | | | | | | | | * Add socketserver.ForkingMixIn.server_close() bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all child processes completed to prevent leaking zombie processes. * Fix test on Windows which doesn't have ForkingMixIn
* Remove unused imports.Serhiy Storchaka2016-12-161-1/+0
|
* Issue #26721: Change StreamRequestHandler.wfile to BufferedIOBaseMartin Panter2016-06-291-1/+23
|
* Reindent properly.Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-031-76/+74
|
* Issue #25931: Don't defining socketserver.Forking* names on platforms suchGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-031-6/+11
| | | | as Windows that do not support os.fork().
* Issue #26778: Fixed "a/an/and" typos in code comment, documentation and errorSerhiy Storchaka2016-04-171-1/+1
|\ | | | | | | messages.
| * Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
| |
* | Issue #26404: Add context manager to socketserver, by Aviv PalivodaMartin Panter2016-04-131-0/+6
| |
* | Issue #5824: Merge socketserver tests from 3.5Martin Panter2016-02-241-8/+0
|\ \ | |/
| * Issue #5824: Fix DatagramRequestHandler tests by binding the client socketMartin Panter2016-02-241-8/+0
| |
* | Issue #23430: Stop socketserver from catching SystemExit etc from handlersMartin Panter2016-02-211-13/+18
|/ | | | | Also make handle_error() consistently output to stderr, and fix the documentation.
* Issue #26309: Shut down socketserver request if verify_request() is falseMartin Panter2016-02-181-0/+2
| | | | Patch by Aviv Palivoda.
* Issues #26310, #26311: Fix typos in the documentation and code commentsMartin Panter2016-02-101-1/+1
|
* Issue #23285: PEP 475 -- Retry system calls failing with EINTR.Charles-François Natali2015-02-071-2/+0
|
* Issue #23358: Add missing BaseServer entry to socketserver.__all__.Berker Peksag2015-02-031-4/+4
|\ | | | | | | Patch by Martin Panter.
| * Issue #23358: Add missing BaseServer entry to socketserver.__all__.Berker Peksag2015-02-031-4/+4
| | | | | | | | Patch by Martin Panter.
* | Issue #22186: Fix typos in Lib/.Berker Peksag2014-10-191-1/+1
|\ \ | |/ | | | | Patch by Févry Thibault.
* | Issue #22435: Fix a file descriptor leak when SocketServer bind fails.Charles-François Natali2014-10-131-2/+6
|\ \ | |/
| * Issue #22435: Fix a file descriptor leak when SocketServer bind fails.Charles-François Natali2014-10-131-2/+6
| |
| * Issue #21491: socketserver: Fix a race condition in child processes reaping.Charles-François Natali2014-06-201-26/+30
| |
* | Issue #22043: time.monotonic() is now always availableVictor Stinner2014-09-021-4/+1
| | | | | | | | | | threading.Lock.acquire(), threading.RLock.acquire() and socket operations now use a monotonic clock, instead of the system clock, when a timeout is used.
* | Issue #21491: socketserver: Fix a race condition in child processes reaping.Charles-François Natali2014-06-201-26/+30
| |
* | Issue #21040: socketserver: Use the selectors module.Charles-François Natali2014-03-241-41/+57
|/
* Issue #20976: pyflakes: Remove unused importsVictor Stinner2014-03-201-1/+0
|
* Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a)Brett Cannon2013-07-041-1/+1
|
* Issue #18200: Update the stdlib (except tests) to useBrett Cannon2013-06-141-1/+1
| | | | ModuleNotFoundError.
* Merge with 3.3Kristján Valur Jónsson2012-12-261-1/+6
|\ | | | | | | Issue #14574: Ignore socket errors raised when flushing a connection on close.
| * Merge with 3.2 :Kristján Valur Jónsson2012-12-261-1/+6
| |\ | | | | | | | | | Issue #14574: Ignore socket errors raised when flushing a connection on close.
| | * Issue #14574: Ignore socket errors raised when flushing a connection on close.Kristján Valur Jónsson2012-12-251-1/+6
| | |
| | * Fix the patch for issue #7978: select() raises select.error before 3.3, not ↵Antoine Pitrou2012-04-081-2/+2
| | | | | | | | | | | | OSError.
* | | Issue #16717: get rid of socket.error, replace with OSErrorAndrew Svetlov2012-12-181-2/+2
| | |
* | | Issue #16706: get rid of os.errorAndrew Svetlov2012-12-181-2/+2
|/ /
* | #11109: clean up docs, add whatsnew entry, and fix Justin's last name.R David Murray2012-10-021-1/+1
| |
* | Issue #7978: socketserver now restarts the select() call when EINTR is returned.Antoine Pitrou2012-04-081-2/+13
|\ \ | |/ | | | | | | This avoids crashing the server loop when a signal is received. Patch by Jerzy Kozera.
| * Issue #7978: socketserver now restarts the select() call when EINTR is returned.Antoine Pitrou2012-04-081-2/+13
| | | | | | | | | | This avoids crashing the server loop when a signal is received. Patch by Jerzy Kozera.
* | Merge 3.2: issue #13140Florent Xicluna2011-11-041-2/+1
|\ \ | |/
| * Closes #13140: Fix the daemon_threads attribute of ThreadingMixIn.Florent Xicluna2011-11-041-2/+1
| |
* | #13289: merge with 3.2.Ezio Melotti2011-10-291-1/+1
|\ \ | |/
| * #13289: fix typo.Ezio Melotti2011-10-291-1/+1
| |