Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.13] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973)#126869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 1 commit intopython:3.13frommiss-islington:backport-ba088c8-3.13
Nov 15, 2024

Conversation

@miss-islington
Copy link
Contributor

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.

(cherry picked from commitba088c8)

Co-authored-by: Petr Viktorinencukou@gmail.com
Co-Authored-By: Akinori Hattorihattya@gmail.com

…124973)*pythongh-71936: Fix race condition in multiprocessing.PoolProxes of shared objects register a Finalizer in BaseProxy._incref(), and itwill call BaseProxy._decref() when it is GCed. This may cause a race conditionwith 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 objectis 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.(cherry picked from commitba088c8)Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-Authored-By: Akinori Hattori <hattya@gmail.com>
@encukouencukouenabled auto-merge (squash)November 15, 2024 13:38
@encukouencukou merged commit7be8743 intopython:3.13Nov 15, 2024
38 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadAwaiting requested review from gpsheadgpshead is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@miss-islington@encukou

[8]ページ先頭

©2009-2025 Movatter.jp