Parallelize adapter execution in run_all via ThreadPoolExecutor - #68
Open
qiaobochi040726-source wants to merge 2 commits into
Open
Parallelize adapter execution in run_all via ThreadPoolExecutor#68qiaobochi040726-source wants to merge 2 commits into
qiaobochi040726-source wants to merge 2 commits into
Conversation
Run enabled adapters concurrently in a thread pool (IO/subprocess-bound, CPU-light work) instead of sequentially. Worker count equals the number of enabled adapters. Preserve config order by collecting futures in submission order, and keep per-adapter error semantics (AdapterError / unexpected errors become ToolRunResult error entries without aborting other adapters). Adds tests proving concurrency (threading.Barrier + wall-clock < sequential sum), config-order preservation, and that one failing adapter under concurrency does not break the others.
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 #45
适配器并发执行(ThreadPoolExecutor,线程池——适配器是 IO/子进程重、CPU 轻):
_run_one()提取单适配器执行,AdapterError/意外异常 → 错误条目,不拖垮其他适配器验证:pytest 19 passed(基线 15+4)。遗留:未设 worker 硬上限(当前 4 个适配器足够,超 8 个时需加);适配器内部若有非线程安全全局状态需注意。