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

Future.__del__ logs ignored exceptions during interpreter shutdown #8500

Open
hendrikmakait opened this issue Feb 7, 2024 · 1 comment
Open
Assignees
Labels
bug Something is broken

Comments

@hendrikmakait
Copy link
Member

While I don't have a reproducer, multiple users have reported seeing many logs about Future.__del__ ignoring exceptions during interpreter shutdown. #8449 was supposed to address this, but it failed to do so:

Before #8449

Exception ignored in: <function Future.__del__ at 0x...>
Traceback (most recent call last):
  File "/python/lib/python3.10/site-packages/distributed/client.py", line 510, in __del__
AttributeError: 'NoneType' object has no attribute 'is_finalizing'

After #8449

Exception ignored in: <function Future.__del__ at 0x...>
Traceback (most recent call last):
  File "/python/lib/python3.10/site-packages/distributed/client.py", line 510, in __del__
TypeError: 'NoneType' object is not callable

From what I understand, this fails because of this caveat: https://github.com/python/cpython/blob/e39ae6bef2c357a88e232dcab2e4b4c0f367544b/Doc/c-api/init.rst#L403-L405

Empirically, we can fix the Future.__del__ problem by binding sys.is_finalizing to a class variable which will avoid its destruction. However, I assume that is_python_shutting_down has a similar problem. While this issue isn't urgent, the chattiness is annoying and might distract from genuine issues on shutdown.

@hendrikmakait hendrikmakait added the bug Something is broken label Feb 7, 2024
@hendrikmakait hendrikmakait self-assigned this Feb 7, 2024
@csubich
Copy link

csubich commented Oct 23, 2024

Since this is otherwise a benign error, would there be any harm in rewriting the test as if (is_python_shutting_down is not None and not is_python_shutting_down())?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants