-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
For issues like: https://www.mongodb.com/community/forums/t/connection-timed-out-errors-while-creating-index/240271
It would be helpful to add more information to network timeout errors. For example we could add the timeout being used (eg connectTimeout/socketTimeout/csot timeout) and perhaps the time elapsed before the exception was raised.
For example the current behavior is:
>>> c = MongoClient(socketTimeoutMS=1) >>> c.t.t.find_one({}) Traceback (most recent call last): ... File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", line 402, in _raise_connection_failure raise NetworkTimeout(msg) from error pymongo.errors.NetworkTimeout: localhost:27017: timed out
We could raise something like this:
>>> c = MongoClient(socketTimeoutMS=1) >>> c.t.t.find_one({}) Traceback (most recent call last): ... File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", line 402, in _raise_connection_failure raise NetworkTimeout(msg) from error pymongo.errors.NetworkTimeout: localhost:27017: timed out (waited 1ms, configured timeout was 1ms)
- causes
-
PYTHON-4632 test_connection_timeout_message takes 30 seconds
- Closed