Commit Graph

27 Commits

Author SHA1 Message Date
Noah Stapp
34ca694c9f
PYTHON-3801 gRPC POC phase 1 (#1317) 2023-07-26 14:01:22 -07:00
Noah Stapp
b16e06acfd
PYTHON-3727 Use tox for unit tests and switch to pytest (#1249) 2023-06-21 15:07:14 -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
d2b95d1bf0
PYTHON-3336 Test Failure - test_load_balancer failing (#1000) 2022-07-08 19:40:25 -05:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting (#868) 2022-02-17 06:44:08 -06:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
f4cef37328
PYTHON-3064 Add typings to test package (#844) 2022-02-07 19:33:41 -06:00
Shane Harvey
c94a3ad1df
PYTHON-2585 Remove legacy multi-auth code (#816) 2021-12-09 18:00:41 -08:00
Shane Harvey
968ee7ba96
PYTHON-2868 Test Serverless behind a load balancer (#742) 2021-09-23 15:57:57 -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
Shane Harvey
f541e7731c
PYTHON-2602 Test that pool paused errors are retryable (#681)
Allow client_knobs to be used as a decorator.
2021-07-30 17:56:01 -07:00
Shane Harvey
97a84e199e
PYTHON-2697 Fix races in various CMAP spec tests (#685) 2021-07-29 17:25:15 -07:00
Shane Harvey
4c77d7c855
PYTHON-2677 Better wait queue timeout errors for load balanced clusters (#639)
Remove checkout argument in favor of SocketInfo.pin_txn/pin_cursor()
2021-06-21 18:29:36 -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
f64b563d9e
PYTHON-2629 Use hello command when API Version is declared (#610)
PYTHON-2697 Update CMAP runner to ignore extra events
2021-05-10 14:33:51 -07:00
Shane Harvey
4c7718eb5a
PYTHON-2634 Only update pools for data-bearing servers (#590)
Fixes a noisy OperationFailure: Authentication failed error.
Do not attempt to create unneeded connections to arbiters, ghosts,
hidden members, or unknown members.
2021-04-19 13:24:54 -07: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
ac07e0f4e2
PYTHON-2447 Fix race in CMAP maxConnecting test (#529) 2020-12-07 08:59:33 -10:00
Shane Harvey
807ab5ac9c
PYTHON-2363 Skip CMAP test when failCommand is not supported (#523) 2020-11-23 18:46:58 -08:00
Shane Harvey
d1fd3f7e98
PYTHON-2363 Rate limit new connection creations via maxConnecting (#511)
At most 2 connections can be in the pending state per connection pool.
The pending state covers all the work required to setup a new connection
including TCP, TLS, and MongoDB authentication. For example, if two
threads are currently creating connections, a third thread will wait for
either an existing connection to be checked back into the pool or for
one of the two threads to finish creating a connection.

The change reduces the likelihood of connection storms and improves the
driver's ability to reuse existing connections.
2020-11-23 15:55:54 -08:00
Shane Harvey
337a08c43d
PYTHON-2360 Ensure ConnectionCreatedEvents are emitted before ConnectionReadyEvents (#493)
Connections created in the background (for minPoolSize) are authenticated.
2020-10-06 11:37:27 -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
Shane Harvey
6ee80cecfa PYTHON-2124 Assert no gc.garbage at test suite teardown and enable debug output 2020-02-20 15:04:31 -08:00
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
0f30d16554 PYTHON-1873 Remove flawed CMAP fairness test
Print debug info when a CMAP test fails.
2019-06-27 18:45:21 -07:00
Shane Harvey
f588412b67 PYTHON-1842 Implement Connection Monitoring and Pooling spec 2019-06-13 15:50:49 -07:00