Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1414.
The reranker starts daemon workers. Python's multiprocessing exit handler terminates and joins them before late object finalization. Running the ordinary pool and device cleanup again from a late destructor can call into partially cleared modules, as in the reported SIGTERM traceback.
Skip that second cleanup during interpreter finalization. Keep a reference to the finalization check on the destructor itself so it remains available during teardown. Explicit pool shutdown and garbage collection during normal execution still use the existing cleanup path.
The regression test launches a fresh CPython process and holds one reranker until exit. On the parent commit both objects entered pool cleanup. With the change only the normally collected object did.
I also ran the public scoring path on Windows with two spawned CPU workers, then exercised ordinary collection and process exit in separate runs. Both returned scores [3, 4], and all four worker PIDs had exited afterward. These runs exercise the shutdown lifecycle on Windows. The original SIGTERM traceback was reported on Linux.