-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: SDAM
-
None
MongoClient currently performs the SRV+TXT resolution directly in the constructor. The downside is that if the SRV or TXT lookup fails due to a transient DNS error then the entire client fails to be created.
MongoClient should perform SRV resolution lazily to make it more robust. If the SRV resolution consistently fails, then the first operation should raise an informative server selection error indicating the SRV/TXT error.
I'm thinking we can defer the initial SRV/TXT lookup to the client's background thread.
NOTE: AsyncMongoClient no longer performs dns resolution for "mongodb+srv://" connection string in the constructor. To avoid blocking the asyncio loop, the resolution is now deferred until the client is first connected.
- fixes
-
PYTHON-5226 SRV polling dns lookup blocks the asyncio loop
-
- Blocked
-
- is related to
-
PYTHON-1687 Allow uri_parser to render a working connection string after validation
-
- Backlog
-
-
DRIVERS-2757 Retry on DNS failure
-
- Backlog
-