Skip to content

feat: concurrent document indexing in index_folder (BRIC-8)#9

Merged
Kaiohz merged 1 commit intomainfrom
BRIC-8/concurrent-index-folder
Apr 9, 2026
Merged

feat: concurrent document indexing in index_folder (BRIC-8)#9
Kaiohz merged 1 commit intomainfrom
BRIC-8/concurrent-index-folder

Conversation

@Kaiohz
Copy link
Copy Markdown
Collaborator

@Kaiohz Kaiohz commented Apr 9, 2026

Summary

Replace the sequential for loop in LightRAGAdapter.index_folder with asyncio.Semaphore + asyncio.gather to process documents concurrently, bounded by the existing MAX_CONCURRENT_FILES config.

Changes

  • src/infrastructure/rag/lightrag_adapter.py: Replaced sequential loop with concurrent pattern using asyncio.Semaphore(max(1, MAX_CONCURRENT_FILES)) + asyncio.gather. Removed 103 lines of dead code.

  • tests/unit/test_lightrag_adapter.py: Added 6 tests verifying: semaphore enforcement, zero-concurrency, excess capacity, single file, and mixed success/failure.

Acceptance Criteria (BRIC-8)

All 10 acceptance criteria verified.

Testing

  • 127 unit tests pass (6 new + 121 existing)
  • SonarQube: 0 new issues
  • Trivy: 0 new vulnerabilities
  • QA: Container healthy, folder indexing verified

Jira

BRIC-8

Replace sequential for-loop with asyncio.Semaphore + asyncio.gather,
bounded by MAX_CONCURRENT_FILES config. Dead code removed (103 lines).
6 new tests verify concurrency, edge cases, and mixed success/failure.
@Kaiohz Kaiohz merged commit 86f850d into main Apr 9, 2026
1 check passed
@Kaiohz Kaiohz deleted the BRIC-8/concurrent-index-folder branch April 9, 2026 09:12
@Kaiohz
Copy link
Copy Markdown
Collaborator Author

Kaiohz commented Apr 13, 2026

🟢 Code Review — BRIC-8: Concurrent document indexing

✅ Points positifs

  • Pattern asyncio.Semaphore + gather bien implémenté pour la concurrence
  • 6 nouveaux tests (semaphore enforcement, zero-concurrency, excess capacity, single file, mixed success/failure)
  • 103 lignes de dead code supprimées
  • 127 tests passent, SonarQube clean

⚠️ Points d'attention

  1. Fallback silencieux si MAX_CONCURRENT_FILES=0 → le max(1, ...) masque une config potentiellement intentionnelle à 0

Score de confiance : 8/10

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