Staging
v0.8.1
https://github.com/python/cpython
Revision c41559021213cfc9dc62a83fc63306b3bdc3e64b authored by MARUYAMA Norihiro on 01 November 2020, 23:51:04 UTC, committed by GitHub on 01 November 2020, 23:51:04 UTC
* 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>
1 parent e662c39
History
Tip revision: c41559021213cfc9dc62a83fc63306b3bdc3e64b authored by MARUYAMA Norihiro on 01 November 2020, 23:51:04 UTC
bpo-37193: remove thread objects which finished process its request (GH-13893)
Tip revision: c415590
File Mode Size
Python.asdl -rw-r--r-- 5.2 KB
asdl.py -rw-r--r-- 12.7 KB
asdl_c.py -rwxr-xr-x 49.1 KB
myreadline.c -rw-r--r-- 11.6 KB
parser.c -rw-r--r-- 841.9 KB
peg_api.c -rw-r--r-- 2.2 KB
pegen.c -rw-r--r-- 61.7 KB
pegen.h -rw-r--r-- 10.0 KB
string_parser.c -rw-r--r-- 38.5 KB
string_parser.h -rw-r--r-- 1.8 KB
token.c -rw-r--r-- 4.5 KB
tokenizer.c -rw-r--r-- 56.9 KB
tokenizer.h -rw-r--r-- 3.8 KB

back to top