feat: enhance NebulaGraph pool management & improve Searcher usage logging #265
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.
Description
Summary:
NebulaGraphDB
Added shared pool cache & refcounting with thread-safe lock to reuse connections across instances.
Implemented _make_pool_key, _get_or_create_shared_pool, _release_shared_pool, close_all_shared_pools.
Updated init to use shared pool acquisition strategy instead of creating new pool each time.
Adjusted close() to only release shared pool when refcount reaches zero; added safe del.
Increased default query timeout from 5s → 10s.
Simplified node property parsing with _build_return_fields helper.
Added include_embedding option to get_neighbors_by_tag, improved return parsing.
Refactored multiple query result parsers to unify props extraction.
Searcher
Introduced dedicated ThreadPoolExecutor(max_workers=4) for async usage updates.
Changed _update_usage_history to work with batched payloads and safe info snapshotting.
Added _update_usage_history_worker for async DB updates with exception handling.
Fixed duplicated rerank top_k scaling in _retrieve_from_long_term_and_user and _retrieve_from_memcubes.
Fix: #(issue)
Docs Issue/PR: (docs-issue-or-pr-link)
Reviewer: @(reviewer)
Checklist: