Commit Graph

96 Commits

Author SHA1 Message Date
Noah Stapp
9a8e34c726
PYTHON-5366 - test_pool_reset waits until Pool.reset() increments gen… (#2797) 2026-05-18 10:29:44 -04:00
Noah Stapp
0cfba4994d
PYTHON-5662 - Add support for server selection's deprioritized servers to all topologies (#2639) 2025-12-16 12:21:45 -05:00
Steven Silvester
06872f7f03
PYTHON-4780 Implement fast path for server selection with Primary (#2416) 2025-07-22 10:23:26 -05:00
Steven Silvester
0b2900d162
PYTHON-5413 Handle flaky tests (#2395) 2025-07-01 15:42:58 -05:00
Noah Stapp
e2bfa9a590
PYTHON-5248 - Drop support for MongoDB 4.0 (#2353) 2025-06-20 14:25:19 -04:00
Noah Stapp
aa41e70523
PYTHON-5369 - Re-raise socket.timeout errors if the deadline has alre… (#2326) 2025-05-12 09:28:05 -04:00
Noah Stapp
34ca759f85
PYTHON-5113 - Refactor test utils for async (#2149) 2025-03-12 12:59:56 -04:00
Shane Harvey
ac198af557
PYTHON-4729 Drop support for MongoDB 3.6 (#1905) 2024-10-09 09:58:20 -07:00
Shane Harvey
26f7a9d2ca
PYTHON-4524 Bump maxWireVersion for MongoDB 8.0 (#1720) 2024-06-27 13:46:30 -07:00
Noah Stapp
ffa6555485
PYTHON-4476 Separate data and IO classes more effectively (#1678) 2024-06-26 10:12:39 -07:00
Noah Stapp
d6bf0e1e78
PYTHON-4264 Async PyMongo Beta (#1629) 2024-06-06 09:01:24 -07:00
Noah Stapp
ebb94b669e
PYTHON-3457 Easier debugging with standardized logging (#1515)
PYTHON-3458 Add command logging.
PYTHON-3459 Add server selection logging.
PYTHON-3473 Add connection pool logging.
PYTHON-4167 Add documentation and examples.

Co-authored-by: sleepyStick <itsirisho@gmail.com>
2024-02-15 11:35:08 -08:00
Noah Stapp
5dc60342ed
PYTHON-2834 Direct read/write retries to another mongos if possible (#1421) 2023-11-14 12:49:42 -08:00
Steven Silvester
923c8a5abe
PYTHON-4024 Use ruff formatter (#1419) 2023-11-02 12:46:40 -05:00
Steven Silvester
992d1507e7
PYTHON-4005 Replace flake8 and isort with ruff (#1399) 2023-10-19 11:56:22 -05:00
Iris
5c3cfa7848
PYTHON-3764 add types to settings.py (#1259) 2023-06-27 13:16:20 -07:00
Shane Harvey
0092b0af79
PYTHON-2504 Run pyupgrade 3.4.0 and ruff 0.0.265 (#1196)
pyupgrade --py37-plus bson/*.py pymongo/*.py gridfs/*.py test/*.py tools/*.py test/*/*.py
ruff --fix-only --select ALL --fixable ALL --target-version py37 --line-length=100 --unfixable COM812,D400,D415,ERA001,RUF100,SIM108,D211,D212,SIM105,SIM,PT,ANN204,EM bson/*.py pymongo/*.py gridfs/*.py test/*.py test/*/*.py
2023-05-11 15:27:17 -07:00
Steven Silvester
f7225fda55
PYTHON-3652 Bump maxWireVersion for MongoDB 7.0 (#1188) 2023-04-12 10:40:44 -05:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Shane Harvey
11752ed594
PYTHON-2899 Remove code for MongoDB <= 3.4 (#729)
Remove unneeded memoryview to bytes conversion.
2021-09-16 16:53:50 -07:00
Julius Park
3b8961a76e
PYTHON-2679 Auto discover replica sets by default (#716) 2021-09-14 14:00:13 -07:00
Bernie Hackett
ad4315134c PYTHON-2803 Get rid of most uses of 'master'
This change also resolves PYTHON-2848 for MongoDB 4.0.
2021-09-13 12:50:49 -07:00
Bernie Hackett
146179db53 PYTHON-2803 Eliminate the use of 'slave' 2021-09-13 12:47:24 -07:00
Prashant Mital
3f8c104157
PYTHON-2288 Remove IsMaster (#690) 2021-07-29 10:32:51 -07:00
Shane Harvey
b823b95de1
PYTHON-2791 Ignore erroneous serviceId field for non-LB connections (#663) 2021-06-30 18:31:00 -07:00
Bernie Hackett
83adc9af03 PYTHON-2740 Bump maxWireVersion for MongoDB 5.0 2021-06-16 15:49:32 -07:00
Shane Harvey
112ee69de8
PYTHON-2674 Pool.reset only clears connections to the given serviceId (#628) 2021-06-15 09:52:30 -07:00
Shane Harvey
93ac5e0277
PYTHON-2676 Add load balancer tests in EVG (#625)
Add load balancer spec tests
Ensure LB supports retryable reads/writes
Add assertNumberConnectionsCheckedOut, createFindCursor, ignoreResultAndError
Add PoolClearedEvent.service_id and fix isClientError unified test assertion
2021-05-27 15:05:26 -07:00
Shane Harvey
454d77b783
PYTHON-1309 Remove helpers for getLastError (#554)
Remove Database.error, Database.last_status, Database.previous_error,
and Database.reset_error_history.
2021-01-20 16:38:07 -08:00
Bernie Hackett
a72e8b8823 PYTHON-2133 Remove py2 support from test
Also delete bson/py3compat.py
2021-01-20 09:40:36 -08:00
Shane Harvey
86b40c195d
PYTHON-2462 Avoid connection storms: implement pool PAUSED state (#531)
Mark server unknown and clear the pool when background connections fail.
Eagerly evict threads from the wait queue when pool is paused. Evicted
threads will raise the following error:
AutoReconnect('localhost:27017: connection pool paused')
Introduce PoolClearedEvent and ConnectionPoolListener.pool_ready.

CMAP spec test changes:
- CMAP unit tests should not use real monitors
- Assert that CMAP threads complete all scheduled operations
2021-01-06 15:15:37 -08:00
Shane Harvey
64f77068e1
PYTHON-1438 Mark a server unknown when connection handshake fails with a network timeout error (#461) 2020-07-08 17:46:07 -07:00
Shane Harvey
1f4123e4bf PYTHON-2123 Streaming heartbeat protocol
MongoClient now requires 2 connections and 2 threads to each MongoDB 4.4+ server.
With one connection, the server streams (or pushes) updated heartbeat info.
With the other connection, the client periodically pings the server to
establish an accurate round-trip time (RTT). This change optimizes the
discovery of server state changes such as replica set elections.

Additional changes:
- Mark server Unknown before retrying isMaster check.
- Always reset the pool _after_ marking the server unknown.
- Configure fail point before creating the client in test SpecRunner.
- Unfreeze with replSetFreeze:0 to ensure a speedy elections in test suite.
2020-07-01 14:49:46 -07:00
Julius Park
815c924bc3
PYTHON-2136: added more diagnostic information for ServerSelectionTimeoutError (#444)
* PYTHON-2136: added more diagnostic information for ServerSelectionTimeoutError

* made error message more human readable

* fixed tests

* fixed remaining testcase

* fixed formatting

* more formatting fixes
2020-06-25 17:04:04 -04:00
Shane Harvey
9a9f42bb99 PYTHON-2236 Reset the server pool only after marking the server Unknown 2020-06-08 11:48:44 -07:00
Shane Harvey
6e39ae04c3 PYTHON-2170 Add support for 4.4 hedged reads 2020-05-07 17:26:00 -07:00
Shane Harvey
7099e1be8b PYTHON-2199 Reduce race conditions in SDAM error handling
Use Pool.generation and topologyVersion to reduce race conditions
SDAM error handling.
Implement SDAM error handling spec tests.
2020-04-28 16:47:13 -07:00
Shane Harvey
250364f608 PYTHON-2116 Sort servers by address in topology repr 2020-04-23 16:11:28 -07:00
Shane Harvey
463d759ddc PYTHON-2116 Add __repr__ to monitoring events and description classes 2020-04-20 16:13:14 -07:00
Shane Harvey
350ada10d5 PYTHON-2206 Rename pool_id to generation to better match CMAP spec 2020-04-16 11:46:54 -07:00
Shane Harvey
6609cc5714 PYTHON-2098 Publish server/topology events when reseting a server due to an application error 2020-02-11 11:50:45 -08:00
Prashant Mital
ed4204f237
PYTHON-1954 Stop holding the topology lock while creating new connections 2019-12-05 09:58:58 +05:30
Prashant Mital
611c3f86b3
PYTHON-1677 Connections survive primary stepdown 2019-08-06 13:08:15 -07:00
Shane Harvey
77913c7d36 PYTHON-1900 Add "connectionError" as a valid ConnectionCheckOutFailedEvent reason 2019-07-17 14:15:55 -07:00
Shane Harvey
f588412b67 PYTHON-1842 Implement Connection Monitoring and Pooling spec 2019-06-13 15:50:49 -07:00
Shane Harvey
77804b1aed PYTHON-1422 Don't update a closed topology 2018-02-20 14:12:32 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
b878ed60ca PYTHON-1409 - Improve server compatibility error messages 2017-11-13 15:03:47 -08:00
A. Jesse Jiryu Davis
dcd8f68994 PYTHON-1332 - send $clusterTime with isMaster 2017-10-23 18:01:59 -04:00
A. Jesse Jiryu Davis
b273d94358 PYTHON-1299 - Use new wire version in tests 2017-08-24 08:57:36 -04:00