Author damian.barabonkov
Recipients damian.barabonkov
Date 2020-07-30.17:19:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596129575.64.0.828449737414.issue41447@roundup.psfhosted.org>
In-reply-to
Content
The way the resource tracker is used in /Lib/multiprocessing/shared_memory.py leads to it issuing warnings/errors, even when resources are cleaned up properly.

Attached are two simple demo files copied from the documentation example (https://docs.python.org/3.9/library/multiprocessing.shared_memory.html) that illustrate the warnings below: 

proc1.py

Traceback (most recent call last):
  File "proc1.py", line 19, in <module>
    shm.unlink()  # Free and release the shared memory block at the very end
  File "/home/damian/Documents/QuantCo/miniconda3/envs/pipeline-parallel/lib/python3.8/multiprocessing/shared_memory.py", line 244, in unlink
    _posixshmem.shm_unlink(self._name)
FileNotFoundError: [Errno 2] No such file or directory: '/shmem'
/home/damian/Documents/QuantCo/miniconda3/envs/pipeline-parallel/lib/python3.8/multiprocessing/resource_tracker.py:218: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/home/damian/Documents/QuantCo/miniconda3/envs/pipeline-parallel/lib/python3.8/multiprocessing/resource_tracker.py:231: UserWarning: resource_tracker: '/shmem': [Errno 2] No such file or directory: '/shmem'
  warnings.warn('resource_tracker: %r: %s' % (name, e))


proc2.py

python3.8/multiprocessing/resource_tracker.py:218: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
History
Date User Action Args
2020-07-30 17:19:35damian.barabonkovsetrecipients: + damian.barabonkov
2020-07-30 17:19:35damian.barabonkovsetmessageid: <1596129575.64.0.828449737414.issue41447@roundup.psfhosted.org>
2020-07-30 17:19:35damian.barabonkovlinkissue41447 messages
2020-07-30 17:19:35damian.barabonkovcreate