fix(vec_dbs): qdrant client explicit timeout + transient backoff retry - #2404
larryluozhang wants to merge 1 commit into
Conversation
Added a backoff mechanism for handling transient errors during client calls.
🤖 Open Code ReviewTarget: PR #2404 🔍 OpenCodeReview found 4 issue(s) in this PR. 1.
|
✅ Automated Test Results: PASSEDAll tests passed (2/2 executed). memos_python_core/changed-python-source: 2/2. Duration: 8s [advisory, non-gating] AI-generated tests on branch test/auto-gen-86cdf9eb52bea840-20260922093054: 79/79 passed — these do NOT affect the PR verdict; review the branch manually. Branch: |
Problem
qdrant-clientdefaults to a 5s timeout. Under host memory pressure thisfalse-fails en masse (
[VecDB] search failed: timed outthousands of times aday), and callers treat the resulting empty result sets as batch failures —
which then retry whole batches and amplify load (observed retry storms of
30-57 repeats per request, contributing to RSS churn and daily restarts).
Fix
QDRANT_CLIENT_TIMEOUT(default 30s)search()/get_by_ids()retry transient errors (timeout/connection/503)with 2s→5s exponential backoff + jitter (max 2 retries); other errors raise
immediately.