cpython/Lib
Petr Viktorin ba088c8f9c
gh-71936: Fix race condition in multiprocessing.Pool (GH-124973)
* gh-71936: Fix race condition in multiprocessing.Pool

Proxes of shared objects register a Finalizer in BaseProxy._incref(), and it
will call BaseProxy._decref() when it is GCed. This may cause a race condition
with Pool(maxtasksperchild=None) on Windows.

A connection would be closed and raised TypeError when a GC occurs between
_ConnectionBase._check_writable() and _ConnectionBase._send_bytes() in
_ConnectionBase.send() in the second or later task, and a new object
is allocated that shares the id() of a previously deleted one.

Instead of using the id() of the token (or the proxy), use a unique,
non-reusable number.

Co-Authored-By: Akinori Hattori <hattya@gmail.com>
2024-11-13 10:25:10 +01:00
..
__phello__
_pyrepl gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999) 2024-10-14 15:53:50 +02:00
asyncio gh-126353: remove implicit creation of loop from `asyncio.get_event_loop` (#126354) 2024-11-04 14:21:20 +05:30
collections gh-125245: Fix race condition when importing `collections.abc` (#125415) 2024-10-24 18:12:51 -04:00
concurrent gh-125864: Propagate `pickle.loads()` failures in `InterpreterPoolExecutor` (gh-125898) 2024-10-24 10:51:45 -06:00
ctypes gh-123610: Added additional types to ctypes/wintypes.py (GH-124086) 2024-10-18 13:45:17 +01:00
curses
dbm
email gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
encodings
ensurepip gh-91818: Use default program name in the CLI of many modules (GH-124867) 2024-10-10 00:20:53 +03:00
html
http gh-126156: Improve performance of creating `Morsel` objects (#126157) 2024-10-31 12:05:40 -07:00
idlelib Fix idlelib typos (#125484) 2024-10-14 17:11:58 -04:00
importlib gh-125519: Improve traceback if `importlib.reload()` is called with a non-module object (#125520) 2024-10-21 07:53:21 +01:00
json gh-125660: Reject invalid unicode escapes for Python implementation of JSON decoder (GH-125683) 2024-10-18 15:29:47 +03:00
logging gh-124653: Relax (again) detection of queue API for logging handlers (GH-124897) 2024-10-07 19:42:19 +01:00
multiprocessing gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) 2024-11-13 10:25:10 +01:00
pathlib pathlib ABCs: tighten up `resolve()` and `absolute()` (#126611) 2024-11-09 18:47:49 +00:00
pydoc_data Python 3.14.0a1 2024-10-15 22:34:54 +03:00
re gh-126505: Fix bugs in compiling case-insensitive character classes (GH-126557) 2024-11-11 18:27:26 +02:00
site-packages
sqlite3 gh-91818: Use default program name in the CLI of many modules (GH-124867) 2024-10-10 00:20:53 +03:00
sysconfig gh-115382: Fix cross compiles when host and target use same SOABI 2024-10-16 23:01:42 +01:00
test gh-104745: Limit starting a patcher more than once without stopping it (#126649) 2024-11-13 08:20:38 +00:00
tkinter gh-123341: Support `tkinter.Event` type subcript (#123353) 2024-09-01 12:47:07 +01:00
tomllib tomllib: Add a comment about implicit lru_cache bound (GH-126078) 2024-10-29 11:36:14 +01:00
turtledemo gh-125665: Update turtledemo docstrings with correct file names (#125691) 2024-10-23 16:29:32 -04:00
unittest gh-104745: Limit starting a patcher more than once without stopping it (#126649) 2024-11-13 08:20:38 +00:00
urllib gh-116897: Deprecate generic false values in urllib.parse.parse_qsl() (GH-116903) 2024-11-12 21:10:29 +02:00
venv gh-124651: Quote template strings in `venv` activation scripts (GH-124712) 2024-10-21 21:48:04 +01:00
wsgiref gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
xml
xmlrpc
zipfile gh-126565: Skip `zipfile.Path.exists` check in write mode (#126576) 2024-11-10 09:57:24 -05:00
zoneinfo
__future__.py
__hello__.py
_aix_support.py
_android_support.py gh-125942: Android: set stdout to `errors="backslashreplace"` (#125943) 2024-10-25 08:35:41 +08:00
_collections_abc.py gh-116938: Clarify documentation of `dict` and `dict.update` regarding the positional argument they accept (#125213) 2024-10-11 23:05:13 +00:00
_colorize.py
_compat_pickle.py
_compression.py
_ios_support.py
_markupbase.py
_opcode_metadata.py GH-125837: Split `LOAD_CONST` into three. (GH-125972) 2024-10-29 11:15:42 +00:00
_osx_support.py
_py_abc.py
_pydatetime.py gh-41431: Add `datetime.time.strptime()` and `datetime.date.strptime()` (#120752) 2024-09-25 14:43:58 -07:00
_pydecimal.py gh-121798: Add class method Decimal.from_number() (GH-121801) 2024-10-14 08:24:01 +00:00
_pyio.py gh-120754: _io Ensure stat cache is cleared on fd change (#125166) 2024-11-01 22:50:49 +01:00
_pylong.py
_sitebuiltins.py
_strptime.py gh-53203: Fix strptime() for %c, %x and %X formats on many locales (GH-125406) 2024-10-14 16:29:20 +03:00
_threading_local.py
_weakrefset.py gh-89967: make WeakKeyDictionary and WeakValueDictionary thread safe (#125325) 2024-10-13 21:05:05 +05:30
abc.py
annotationlib.py gh-125614: annotationlib: Fix bug where not all Stringifiers are converted (#125635) 2024-10-23 16:27:55 -07:00
antigravity.py
argparse.py gh-117941: Reject option names starting with "--no-" in argparse.BooleanOptionalAction (GH-125894) 2024-11-11 18:28:30 +02:00
ast.py gh-91818: Use default program name in the CLI of many modules (GH-124867) 2024-10-10 00:20:53 +03:00
base64.py
bdb.py gh-58956: Set f_trace on frames with breakpoints after setting a new breakpoint (#124454) 2024-10-15 15:56:33 -04:00
bisect.py
bz2.py
cProfile.py
calendar.py
cmd.py
code.py gh-125666: Avoid PyREPL exiting when a null byte is in input (#125732) 2024-10-27 01:23:53 +00:00
codecs.py
codeop.py gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999) 2024-10-14 15:53:50 +02:00
colorsys.py
compileall.py
configparser.py
contextlib.py
contextvars.py gh-126451: Register contextvars.Context to collections.abc.Mapping (#126452) 2024-11-07 01:12:45 +03:00
copy.py gh-125767: Fix pickling and copying of super objects (GH-125781) 2024-10-21 21:30:45 +03:00
copyreg.py gh-125767: Fix pickling and copying of super objects (GH-125781) 2024-10-21 21:30:45 +03:00
csv.py
dataclasses.py gh-118974: Add `decorator` argument to `make_dataclass` (gh-122723) 2024-10-01 09:51:51 -04:00
datetime.py gh-123843: Remove broken links to the Zope DateTimeWiki (#123846) 2024-09-08 22:39:23 -04:00
decimal.py gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes (GH-123613) 2024-09-28 20:51:49 +03:00
difflib.py
dis.py gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101) 2024-10-30 09:01:09 +00:00
doctest.py gh-120254: Add a `commands` argument to `pdb.set_trace` (#120255) 2024-09-24 12:52:15 -07:00
enum.py gh-125259: Fix error notes removal in enum initialization (GH-125647) 2024-10-22 13:42:22 -07:00
filecmp.py
fileinput.py
fnmatch.py
fractions.py gh-121797: Add class method Fraction.from_number() (GH-121800) 2024-10-14 07:54:59 +00:00
ftplib.py
functools.py gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
genericpath.py
getopt.py gh-126374: Add support of options with optional arguments in the getopt module (GH-126375) 2024-11-11 18:29:28 +02:00
getpass.py
gettext.py
glob.py GH-125413: pathlib ABCs: use `scandir()` to speed up `glob()` (#126261) 2024-11-01 17:48:58 +00:00
graphlib.py gh-115238: Remove a redundant f-string in graphlib (#115239) 2024-09-01 06:12:53 +01:00
gzip.py gh-125260: Change the default ``gzip.compress()`` mtime to 0 (#125261) 2024-10-12 18:18:48 +01:00
hashlib.py Fix typos in warnings, docstrings, comments and text files (#123597) 2024-09-03 02:20:40 +02:00
heapq.py
hmac.py
imaplib.py
inspect.py gh-70764: inspect.getclosurevars now identifies global variables with LOAD_GLOBAL (#120143) 2024-11-05 15:53:54 -08:00
io.py
ipaddress.py gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (#124240) 2024-09-20 11:01:28 +00:00
keyword.py
linecache.py
locale.py
lzma.py
mailbox.py
mimetypes.py gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts (#20199) 2024-11-12 08:48:38 +02:00
modulefinder.py
netrc.py
ntpath.py gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938) 2024-11-12 21:18:03 +00:00
nturl2path.py GH-120423: `pathname2url()`: handle forward slashes in Windows paths (#126593) 2024-11-12 19:52:30 +00:00
numbers.py
opcode.py
operator.py
optparse.py gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
os.py gh-120057: Add os.reload_environ() function (#126268) 2024-11-05 08:43:34 +01:00
pdb.py Fixed a few type mismatches in pdb (#125952) 2024-10-25 00:17:58 -04:00
pickle.py gh-126489: Do not call persistent_id() for a persistent id in Python pickle (GH-126490) 2024-11-06 22:25:14 +02:00
pickletools.py gh-123309: Remove check for redefined memo entry in pickletools.dis() (GH-123374) 2024-08-31 16:21:49 +03:00
pkgutil.py gh-97850: remove ``find_loader`` and ``get_loader`` from ``pkgutil`` (#119656) 2024-11-01 18:35:22 +02:00
platform.py
plistlib.py
poplib.py
posixpath.py
pprint.py
profile.py
pstats.py
pty.py gh-124405: Fix `NameError` in `openpty` (#124406) 2024-09-24 20:06:39 +02:00
py_compile.py
pyclbr.py
pydoc.py gh-101552: Allow pydoc to display signatures in source format (#124669) 2024-10-09 05:03:53 +00:00
queue.py
quopri.py
random.py gh-123968: Fix lower bound for `python -m random --float` (#123971) 2024-09-12 16:54:18 +03:00
reprlib.py gh-113570: reprlib.repr does not use builtin __repr__ for reshadowed builtins (GH-113577) 2024-10-17 16:34:37 +00:00
rlcompleter.py
runpy.py
sched.py
secrets.py
selectors.py
shelve.py
shlex.py
shutil.py gh-117151: increase default buffer size of shutil.copyfileobj() to 256k. (GH-119783) 2024-10-04 16:51:22 -07:00
signal.py
site.py gh-125140: Remove the current directory from sys.path when using pyrepl (GH-125212) 2024-10-09 22:30:56 +00:00
smtplib.py
socket.py gh-121423: Improve import time of `socket` (#121424) 2024-09-04 12:00:37 +02:00
socketserver.py
sre_compile.py
sre_constants.py
sre_parse.py
ssl.py
stat.py
statistics.py Minor code beautifications in statistics.py (gh-124866) 2024-10-01 15:55:36 -05:00
string.py
stringprep.py
struct.py
subprocess.py
symtable.py
tabnanny.py
tarfile.py gh-121267: Improve performance of tarfile (#121267) (#121269) 2024-10-30 15:08:30 -07:00
tempfile.py
textwrap.py gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
this.py
threading.py
timeit.py
token.py
tokenize.py gh-91818: Use default program name in the CLI of many modules (GH-124867) 2024-10-10 00:20:53 +03:00
trace.py
traceback.py gh-125593: Use colors to highlight error locations in tracebacks from exception group (#125681) 2024-10-27 01:57:10 +01:00
tracemalloc.py
tty.py
turtle.py gh-123614: Add save function to turtle.py (#123617) 2024-09-12 21:36:17 -07:00
types.py
typing.py gh-126705: Make os.PathLike more like a protocol (#126706) 2024-11-12 17:54:13 +00:00
uuid.py gh-89083: add support for UUID version 8 (RFC 9562) (#123224) 2024-11-12 19:08:49 +01:00
warnings.py
wave.py
weakref.py gh-89967: make WeakKeyDictionary and WeakValueDictionary thread safe (#125325) 2024-10-13 21:05:05 +05:30
webbrowser.py gh-123494: Improve documentation for ``webbrowser`` return types (#123495) 2024-09-01 06:17:03 +01:00
zipapp.py
zipimport.py gh-121735: Fix module-adjacent references in zip files (#123037) 2024-09-11 22:33:07 -04:00