Skip to content

fix(openai-client): retry transient 5xx on embeddings calls - #170

Merged
pavanputhra merged 1 commit into
mainfrom
worktree-fix-conserver-9g-embedding-retries
May 19, 2026
Merged

pavanputhra merged 1 commit into
mainfrom
worktree-fix-conserver-9g-embedding-retries

Conversation

@pavanputhra

Copy link
Copy Markdown
Contributor

Summary

  • The Milvus storage link calls OpenAI/LiteLLM embeddings through get_openai_client(), which constructs the SDK client with max_retries=0. Any transient upstream 503 from the proxy or provider (e.g. upstream connect error … reset reason: connection termination) therefore surfaces immediately as an unhandled InternalServerError.
  • Embeddings requests are idempotent, so a small retry budget is safe and matches the failure mode (transient network/proxy hiccups with exponential backoff in the SDK).
  • get_openai_client(opts=None, max_retries=0) now takes an explicit kwarg. Default of 0 preserves existing behavior for every other caller; the Milvus embeddings path passes max_retries=3.

Test plan

  • Unit/integration: get_openai_client() still constructs clients with max_retries=0 when no override is passed.
  • Milvus storage link end-to-end: embeddings call succeeds, and a simulated 503 retries instead of bubbling.
  • Monitor Sentry issue for the embeddings error rate after deploy.

🤖 Generated with Claude Code

…R-9G)

The Milvus storage link calls OpenAI/LiteLLM embeddings with max_retries=0,
so any transient upstream 503 (e.g. proxy "upstream connect error /
connection termination") surfaces as an unhandled InternalServerError.
Embeddings are idempotent — retry is safe.

- get_openai_client() gains an optional max_retries kwarg (default 0, so
  existing callers keep current behavior).
- Milvus embeddings save passes max_retries=3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pavanputhra
pavanputhra merged commit 7af9b3b into main May 19, 2026
1 check passed
@pavanputhra
pavanputhra deleted the worktree-fix-conserver-9g-embedding-retries branch May 19, 2026 06:21
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