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

SemLock._cleanup triggers an unraisable exception in Finalizer when a semaphore is manually unlinked first #366

Closed
ogrisel opened this issue Sep 14, 2022 · 0 comments · Fixed by #367

Comments

@ogrisel
Copy link
Collaborator

ogrisel commented Sep 14, 2022

The sl object gets garbage collected and finalized after a manual sem_unlink in test_semlock_failure. This triggers unraisable exception and warning in the pytest report. Furthermore, that prevents the call to resource_tracker.unregister(name, "semlock").

tests/test_synchronize.py::test_semlock_failure
  /Users/ogrisel/mambaforge/envs/dev/lib/python3.10/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <Finalize object, dead>
  
  Traceback (most recent call last):
    File "/Users/ogrisel/mambaforge/envs/dev/lib/python3.10/multiprocessing/util.py", line 224, in __call__
      res = self._callback(*self._args, **self._kwargs)
    File "/Users/ogrisel/code/loky/loky/backend/synchronize.py", line 98, in _cleanup
      sem_unlink(name)
  FileNotFoundError: [Errno 2] No such file or directory
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant