-
Notifications
You must be signed in to change notification settings - Fork 392
Open
0 / 30 of 3 issues completedOpen
0 / 30 of 3 issues completed
Copy link
Labels
kind/bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Description
When multiple MilvusClient instances share the same physical connection (same URI and authentication), calling use_database() on one client modifies the shared GrpcHandler's state, causing other clients to use the wrong database context.
Root Cause
The original design stored db_name as state in GrpcHandler:
GrpcHandlermaintained_current_db_nameor used_db_interceptorto store database informationreset_db_name()modified the handler instance's state- When clients shared the same physical connection (same alias), modifying one handler's state affected all clients using that handler
Steps to Reproduce
# Client A connects to default database
client_a = MilvusClient(uri="http://localhost:19530", db_name="default")
# Client B connects to the same server, reuses the connection
client_b = MilvusClient(uri="http://localhost:19530", db_name="testdb")
# Client A switches database
client_a.use_database("db1") # This modifies the shared GrpcHandler state
# Client B's requests incorrectly use "db1" instead of "testdb"
collections = client_b.list_collections() # ❌ Actually queries db1, not testdbExpected Behavior
- Each client should maintain its own independent
db_namestate - Switching database on one client should not affect other clients
- Physical connections should be safely shareable across different logical databases
Actual Behavior
- Modifying
db_nameon one client affects all clients sharing the same physical connection - Other clients' requests use the wrong database context
- This is a shared state contamination issue
Expected Behavior
No response
Steps/Code To Reproduce behavior
Environment details
- Hardware/Softward conditions (OS, CPU, GPU, Memory):
- Method of installation (Docker, or from source):
- Milvus version (v0.3.1, or v0.4.0):
- Milvus configuration (Settings you made in `server_config.yaml`):Anything else?
No response
Sub-issues
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't working