Skip to content

Conversation

sergey-miryanov
Copy link
Contributor

@sergey-miryanov sergey-miryanov commented Feb 26, 2025

I have implemented proposed solution. Just add try/except and call threading excepthook.

@sergey-miryanov
Copy link
Contributor Author

Please take a look.

@@ -1546,7 +1546,11 @@ def _shutdown():
# Call registered threading atexit functions before threads are joined.
# Order is reversed, similar to atexit.
for atexit_call in reversed(_threading_atexits):
atexit_call()
try:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we handle all exceptions there then test_atexit_after_shutdown fails. Maybe we should ignore specific exception from _register_atexit (that called from atexit handler)?

Copy link
Contributor Author

@sergey-miryanov sergey-miryanov Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OTOH _register_atexit is private, so we can change its behavior. I don't see that b61b818 relying on this particular exception.

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

Successfully merging this pull request may close these issues.

1 participant