Skip to content

chore: do not mutate Config.GrpcOptions when creating a client - #151

Merged
Anush008 merged 2 commits into
qdrant:masterfrom
Tyagiquamar:fix/grpc-client-config-mutation
Sep 5, 2026
Merged

chore: do not mutate Config.GrpcOptions when creating a client#151
Anush008 merged 2 commits into
qdrant:masterfrom
Tyagiquamar:fix/grpc-client-config-mutation

Conversation

@Tyagiquamar

@Tyagiquamar Tyagiquamar commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Problem

NewGrpcClient assigned the combined dial options back into the caller's Config.GrpcOptions. Reusing the same Config therefore accumulated the internally-added default options across client constructions and also mutated caller-owned configuration.

Fix

Build the combined dial options in a local slice and pass that to grpc.NewClient without modifying config.GrpcOptions. This keeps repeated client construction idempotent while preserving user-provided gRPC options.

NewGrpcClient wrote the combined dial options back into the caller's
Config.GrpcOptions. Reusing one Config to create a second client then
duplicated every default option, chaining the retry and metadata
interceptors again per client created and multiplying retry attempts
and backoff. Keep the combined slice local so the caller's config is
left untouched.
Comment thread qdrant_test/client_config_reuse_test.go Outdated
@Anush008

Anush008 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Thanks for taking the time to contribute @Tyagiquamar
Please see the CI failure.

@Anush008 Anush008 changed the title fix(client): do not mutate Config.GrpcOptions when creating a client fix: do not mutate Config.GrpcOptions when creating a client Sep 5, 2026
@Tyagiquamar

Copy link
Copy Markdown
Contributor Author

Done — removed the separate test file and fixed the lint issue. CI is green now. Thanks for the review.

@Anush008 Anush008 changed the title fix: do not mutate Config.GrpcOptions when creating a client chore: do not mutate Config.GrpcOptions when creating a client Sep 5, 2026
@Anush008
Anush008 merged commit 0f036f3 into qdrant:master Sep 5, 2026
2 checks passed
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.

2 participants