python / python/cpython

‘resource_tracker.py’ warns for multiple leaked objects even if only single leak during multiprocessing

Open
#120,280 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic-multiprocessing type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

If there is one object memory leak, the resource_tracker.py warns of multiple leaks which is a misleading description of the multiprocessing error in single cases:

warnings.warn('resource_tracker: There appear to be %d leaked %s objects to clean up at shutdown (len(rtype_cache), rtype))

The language in the warning should not assume there are multiple leaks.

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Linked PRs
  • gh-119558

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in resource_tracker.py at the warning shown in the issue and inspect how the cached resource count is used in its message. Update the wording so it remains accurate for both one and multiple leaked objects, then verify the warning behavior against the existing multiprocessing coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.