8000 gh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon deletion by luccabb · Pull Request #130429 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-88887: Cleanup multiprocessing.resource_tracker.ResourceTracker upon deletion #130429

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
always release + changelog
  • Loading branch information
luccabb committed Mar 19, 2025
commit ba424061c93cb318964f1c4420a8fc720b5329de
12 changes: 7 additions & 5 deletions Lib/multiprocessing/resource_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@ def __del__(self):
def _stop(self, use_blocking_lock=True):
if use_blocking_lock:
with self._lock:
self._stop_unlocked()
self._stop_locked()
else:
acquired = self._lock.acquire(blocking=False)
self._stop_unlocked()
if acquired:
self._lock.release()
try:
self._stop_locked()
finally:
if acquired:
self._lock.release()

def _stop_unlocked(
def _stop_locked(
self,
close=os.close,
waitpid=os.waitpid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fixing multiprocessing Resource Tracker process leaking
Fixing multiprocessing Resource Tracker process leaking, usually observed when running Python as PID 1.
Loading
0