This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register and unload in a python atexit handler.
This works around some nasty thread exit behavior from python, described in more detail at python/cpython#87135 . This behavior was the source of moolib crashes and deadlocks on exit. Luckily, we can essentially unload moolib in an atexit handler - this waits for any callbacks etc to finish, and prevents any more callbacks from being issued. Any python Rpc objects will still be valid, but closed (any operations on them will silently fail). CPython will also then not have an opportunity to exit our async threads, which would result in deadlocks.
- Loading branch information