Skip to content

Conversation

@dolliecoder
Copy link

@dolliecoder dolliecoder commented Feb 3, 2026

fixes #259
Replaced except Exception: pass blocks with logger.exception().

Previously, initialization failures were silently ignored, making debugging difficult.
Now errors are logged with stack traces for better observability.

No behavior changes, only improved logging.

Summary by CodeRabbit

  • Performance

    • Embedding operations now execute asynchronously for improved system responsiveness.
  • Chores

    • Enhanced error reporting for graph initialization operations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Two bug fixes improve error visibility and concurrency: silent exceptions in graph initialization are now logged with descriptive messages, and embedding operations are refactored to execute synchronously in separate threads via asyncio to prevent blocking.

Changes

Cohort / File(s) Summary
Error Logging in Graph Initialization
backend/app/database/falkor/code-graph-backend/api/graph.py
Added module-level logger and replaced silent exception handlers with logger.exception() calls when creating File range index and Searchable fulltext index, enabling error visibility while preserving existing control flow.
Threading for Embedding Operations
backend/app/services/embedding_service/service.py
Introduced asyncio import and private _encode_sync() helper method; refactored get_embedding() and get_embeddings() to execute synchronous model encoding in separate threads via asyncio.to_thread() to prevent blocking.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Whiskers twitching with delight

Errors now reveal their plight,
Logged and visible, shining bright!
Threads dance gently, work flows free,
No more blocking—let it be! 🧵✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes implement logging for swallowed exceptions in graph.py as required [#259], but the embedding_service change (asyncio.to_thread) appears unrelated to the logging objective. Verify that asyncio.to_thread changes in embedding_service/service.py align with issue #259 objectives, or move them to a separate PR focused on event loop blocking prevention.
Out of Scope Changes check ⚠️ Warning The asyncio.to_thread changes to embedding_service/service.py address event loop blocking prevention, not the exception logging objective stated in issue #259. Clarify whether event loop optimization is in scope for this PR, or separate it into a dedicated issue/PR with distinct objectives.
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix/log swallowed exceptions' directly matches the main objective—replacing silent exception handling with logging statements in backend initialization code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

BUG: Silent Exceptions in Backend Initialization Are Not Logged

1 participant