How MilvusClient connection management works
masterIn newer versions of the SDK, MilvusClient uses a ConnectionManager instead of the legacy connections singleton. The ConnectionManager handles connection lifecycle (create, release, close), health checks, and automatic recovery when encountering UNAVAILABLE errors.
It employs a Strategy pattern to distinguish between two types of connection behaviors:
- RegularStrategy: Used for direct connections to a specific endpoint. It always attempts recovery on
UNAVAILABLEerrors. - GlobalStrategy: Used for global clusters. It performs topology discovery, routes to a primary endpoint, and runs background refreshes to keep the topology up to date.
Note: The legacy ORM continues to use the connections singleton until it is deprecated.