fix(indexing): install runtime in worker CLI#1936
Merged
Merged
Conversation
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.
Summary
Hotfix for split-process graph indexing failures:
IndexingRuntimeinpython -m aperag.cli.indexing_workerafter queue/quota/metrics/ProductionWorkerFactoryare constructedcleanup_worker_factory=worker_factory.build_for_cleanup_rowin the worker runtime, while keeping APIcleanup_worker_factory=Noneset_runtime(None)DocumentIndex.tenant_scope_keyinstead of raisingIndexingRuntime is not installed (lifespan never ran)Boundary
This does not move heavy worker logic back into the API process. API-side hard-cut tests remain unchanged and passing.
Verification
uv run pytest tests/unit_test/indexing/test_worker_runtime_install.py tests/unit_test/test_app_lifespan_no_workers.py tests/boundaries/test_worker_di_parity.pyuv run ruff check aperag/cli/indexing_worker.py tests/unit_test/indexing/test_worker_runtime_install.pyuv run ruff format --check aperag/cli/indexing_worker.py tests/unit_test/indexing/test_worker_runtime_install.py