Skip to content

Python: handle Qdrant readiness race after collection creation conflict - #8381

Merged
Evan Mattson (moonbox3) merged 2 commits into
microsoft:mainfrom
moonbox3:stabilize-qdrant-int-test
Sep 15, 2026
Merged

Evan Mattson (moonbox3) merged 2 commits into
microsoft:mainfrom
moonbox3:stabilize-qdrant-int-test

Conversation

@moonbox3

@moonbox3 Evan Mattson (moonbox3) commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Motivation & Context

Concurrent Qdrant collection creation can return HTTP 409 to the losing caller before the winning creator has initialized the collection's shards. The immediate schema lookup then fails with HTTP 500 (0 of 0 read operations failed). This caused both concurrent-creation integration cases to fail in the merge-queue job and was reproduced locally against Qdrant v1.16.2.

Description & Review Guide

  • What are the major changes? Retry the specific readiness response after a creation conflict for both REST (409/500) and gRPC (ALREADY_EXISTS/INTERNAL), with up to five retries and exponential delays totaling 1.55 seconds. Add regression coverage for eventual readiness, schema mismatch, retry exhaustion, and unrelated errors, plus local integration-test instructions.
  • What is the impact of these changes? Concurrent callers can validate the winning collection once it becomes readable. Schema mismatches, unrelated errors, and persistent readiness failures still propagate. Collection creation itself is not retried.
  • What do you want reviewers to focus on? The narrow retry condition and bounded delay. Local verification passed 200 REST and 100 gRPC concurrent-creation cases and all 84 integration tests with the retry plugin disabled, plus 245 unit/local-mode tests and source/test Pyright checks.

Related Issue

None.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The retry is narrowly conditioned, bounded, and adequately covered without masking unrelated failures.

Pull request overview

Adds narrowly scoped retries for Qdrant’s transient post-conflict readiness failure.

Changes:

  • Retries the specific HTTP 500 readiness response after creation conflicts.
  • Adds coverage for success, schema mismatch, exhaustion, and unrelated errors.
  • Documents local integration testing.
File summaries
File Description
agent_framework_qdrant/_vector_store.py Implements bounded readiness retries.
tests/qdrant/test_collection.py Adds regression coverage.
README.md Documents integration-test setup.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (1 commit(s)): 216cd1674855
Model: gpt-5.6-sol-fast

Overview

The PR adds a narrowly matched, bounded asynchronous retry after REST creation conflicts and preserves schema validation once the collection becomes readable. Its tests cover eventual readiness, exhaustion, unrelated errors, and schema mismatch. However, the equivalent supported gRPC conflict path does not enable or handle the readiness retry, so concurrent creation can still fail for supplied clients configured to prefer gRPC.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: python/packages/qdrant/agent_framework_qdrant/_vector_store.py

@moonbox3
Evan Mattson (moonbox3) added this pull request to the merge queue Sep 15, 2026
Merged via the queue into microsoft:main with commit 842909c Sep 15, 2026
42 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 9f16eff3 Deployed Sep 15, 2026 by moonbox3 via add_label #22810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants