Skip to content

fix(indexing): install runtime in worker CLI#1936

Merged
earayu merged 1 commit into
mainfrom
ziang/hotfix-indexing-worker-runtime
Apr 30, 2026
Merged

fix(indexing): install runtime in worker CLI#1936
earayu merged 1 commit into
mainfrom
ziang/hotfix-indexing-worker-runtime

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented Apr 30, 2026

Summary

Hotfix for split-process graph indexing failures:

  • install worker-side IndexingRuntime in python -m aperag.cli.indexing_worker after queue/quota/metrics/ProductionWorkerFactory are constructed
  • wire cleanup_worker_factory=worker_factory.build_for_cleanup_row in the worker runtime, while keeping API cleanup_worker_factory=None
  • clear the process-local runtime on worker shutdown via set_runtime(None)
  • add regression coverage that the CLI-equivalent runtime install lets graph worker factory resolve DocumentIndex.tenant_scope_key instead of raising IndexingRuntime 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.py
  • uv run ruff check aperag/cli/indexing_worker.py tests/unit_test/indexing/test_worker_runtime_install.py
  • uv run ruff format --check aperag/cli/indexing_worker.py tests/unit_test/indexing/test_worker_runtime_install.py

@earayu earayu merged commit 7ca60ab into main Apr 30, 2026
10 checks passed
@earayu earayu deleted the ziang/hotfix-indexing-worker-runtime branch April 30, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant