refactor: use ThreadPoolExecutor in extract_all - #60
Merged
Conversation
Collaborator
Author
|
🤖 AI text below 🤖 All test jobs pass. The "Build distribution" failure is unrelated to this PR: a newly released flit_core emits |
Replaces the hand-rolled Thread/Semaphore machinery, which permanently exhausted a module-level semaphore and deadlocked any second call to extract_all in the same process. Worker exceptions now propagate, so parse failures exit nonzero instead of silently reporting success. This also removes the need for pytest --forked. Addresses findings 1 and 2 of #59. Assisted-by: ClaudeCode:claude-fable-5
cindex raises if set_library_file/path is called after the library is loaded, so a second in-process extract_all call failed on platforms where read_args configures the location. Masked before by pytest --forked; caught by CI on this branch. Assisted-by: ClaudeCode:claude-fable-5
henryiii
force-pushed
the
refactor-thread-pool
branch
from
August 6, 2026 02:06
45c6a0d to
91b6758
Compare
leakec
self-requested a review
August 6, 2026 17:56
leakec
approved these changes
Aug 6, 2026
Collaborator
|
@henryiii This all looks great to me! I don't have any changes to recommend. |
This was referenced Aug 6, 2026
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.
🤖 AI text below 🤖
Addresses findings 1 and 2 of #59.
extract_allused a module-levelSemaphorethat eachExtractionThreadacquired in__init__and thatextract_alldrained as its join, so a second in-process call deadlocked forever (this is why the test suite neededpytest --forked). A relatederrors_detectedglobal mademkdocreturn silently with exit code 0 on parse failures, so build systems saw success with no output file.This replaces the Thread/Semaphore machinery with
concurrent.futures.ThreadPoolExecutor. Worker exceptions now propagate, so failures exit nonzero, and the globals are gone.pytest-forkedand the--forkedflag are removed; the suite now runs in a single process.Beyond CI, the new regression tests were confirmed to fail against the old code: the re-entrancy test hangs, and the exit-code test gets returncode 0.