Skip to content
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

test_concurrent_futures.test_init raises a UserWarning #114062

Closed
Eclips4 opened this issue Jan 14, 2024 · 6 comments
Closed

test_concurrent_futures.test_init raises a UserWarning #114062

Eclips4 opened this issue Jan 14, 2024 · 6 comments
Labels
tests Tests in the Lib/test dir topic-multiprocessing type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Jan 14, 2024

Bug report

Bug description:

Full trace:

./python.exe -m test -R 3:3 test_concurrent_futures.test_init      
Using random seed: 256345264
0:00:00 load avg: 26.64 Run 1 test sequentially
0:00:00 load avg: 26.64 [1/1] test_concurrent_futures.test_init
beginning 6 repetitions
123456
/Users/admin/Projects/cpython/Lib/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-sirq4ugj', '/mp-rl_2jbw3', '/mp-xahxrhsh', '/mp-iizqar8w', '/mp-2hsbr18l', '/mp-0l_el3ow'}
  warnings.warn(
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
./Users/admin/Projects/cpython/Lib/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-lylw1wiw', '/mp-4uiidj6c', '/mp-7_ynxysg', '/mp-fx5syuzw', '/mp-ee8we555', '/mp-txhnr28x'}
  warnings.warn(
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
./Users/admin/Projects/cpython/Lib/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-mey7u772', '/mp-1vws0viu', '/mp-1afg36e2', '/mp-bjp0f0e8', '/mp-7rpmd8vy', '/mp-95_5xypk'}
  warnings.warn(
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
./Users/admin/Projects/cpython/Lib/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-618trphi', '/mp-wumuoxh9', '/mp-67c83ehk', '/mp-gv1cs7ab', '/mp-58aupobv', '/mp-70_ec35j'}
  warnings.warn(
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
./Users/admin/Projects/cpython/Lib/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-micqbsoj', '/mp-t8f_ctlr', '/mp-5ae_spee', '/mp-ukdpimut', '/mp-mzxz9i98', '/mp-z15yhv29'}
  warnings.warn(
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
./Users/admin/Projects/cpython/Lib/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-hnbdlmxa', '/mp-jrz89bu_', '/mp-aqeivj6m', '/mp-5yqnp8sh', '/mp-ga8p0vrj', '/mp-ugk7l_je'}
  warnings.warn(
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 296, in _run_finalizers
    finalizer()
    ~~~~~~~~~^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/util.py", line 220, in __call__
    res = self._callback(*self._args, **self._kwargs)
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/Projects/cpython/Lib/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
    ~~~~~~~~~~^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
.

== Tests result: SUCCESS ==

1 test OK.

Total duration: 8.0 sec
Total tests: run=8
Total test files: run=1/1
Result: SUCCESS

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Jan 14, 2024
@Eclips4
Copy link
Member Author

Eclips4 commented Jan 14, 2024

FYI: I'm not able to reproduce it with --forever ( I mean ./python.exe -m test -v test_concurrent_futures.test_init --forever)

@encukou
Copy link
Member

encukou commented Feb 5, 2024

This just happened on a Mac free-threading refleaks buildbot. The same test leaked a reference.

@encukou
Copy link
Member

encukou commented Feb 5, 2024

Can reproduce consistently on Linux with -R : (that is, ./python -m test test_concurrent_futures.test_init -R:).

@encukou
Copy link
Member

encukou commented Feb 5, 2024

Looks like a test-only issue: in multiprocessing.util._cleanup_tests, this happens:

  • the ResourceTracker is stopped, and it:
    • emits the one-line warning about “leaked semaphore objects to clean up at shutdown”
    • cleans up the semaphores
  • only after that, _run_finalizers runs, cleaning up the semaphores -- but the semaphores are already missing, hence the FileNotFoundError

IMO, it should be fine to switch the order here. Will send a PR after more testing.

@encukou
Copy link
Member

encukou commented Feb 5, 2024

... or maybe these are supposed to be cleaned up before atexit finalizers, and the test should catch this?

@encukou
Copy link
Member

encukou commented Feb 5, 2024

Oh, this is a duplicate of #104090. There's much more info there.

@encukou encukou closed this as completed Feb 5, 2024
@encukou encukou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-multiprocessing type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants