Skip to content

fix(ai): retry a Qdrant call after a 502, 503 or 504 #6757

Closed

Description

@dan-petty

Problem

Checked at main on 2026-11-22.

  • A full devops ai rag index --include-kb run (started 04:16 UTC) stopped at 04:47 UTC with exit 1, at 19456 of 66310 docs chunks: "Error upserting points into 'devops_docs': Unexpected Response: 502 (Bad Gateway)". The body was an HTML error page of the proxy. The Qdrant pod had 0 restarts, so the 502 came from the path in front of Qdrant.
  • _is_transient_qdrant_error (src/devops_cli/ai/rag/qdrant.py:68) counts only ResponseHandlingException and some connection words as transient. qdrant-client 1.20.0 raises UnexpectedResponse with status_code 502 for this answer, so _execute_with_retry does not retry, and _upsert_batch_with_retry stops the run at the first 502.
  • The run lost 31 min of work. The embedding batches already have a retry and a circuit breaker (fix(ai): rag index skips data fixtures and survives a failed batch #6717), but the upsert of their points does not.

Proposed remedy

  • Count UnexpectedResponse with status_code 502, 503 or 504 (and 429) as transient in _is_transient_qdrant_error, so that _execute_with_retry retries it with its backoff.
  • Keep each other status (400, 401, 403, 404, 500) as a permanent error.

Acceptance criteria

  • A test gives _execute_with_retry one UnexpectedResponse with status 502 and then a success, and the call returns the success.
  • A test shows that status 400 is not retried.

Person steps

None.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/ai
    source/agent
    status/new
    effort/low
    on Nov 22, 2026
  2. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P0-Critical. A 31-minute indexing job exits 1 at the first 502, which is a service job failure.
    • Related: fix(http): cluster service reads retry a transient 503 #5532, which asks for a different change. Both retry a transient 503, but #5532 covers cluster service HTTP reads while this candidate covers Qdrant upsert in qdrant.py.
  3. added
    value/high
    priority/p0-critical
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 22, 2026
  4. added
    status/in-review
    and removed
    status/in-progress
    on Nov 22, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 22, 2026
  6. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-22 13:47 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p0-criticalscope/aisource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions