Commit Graph

37 Commits

Author SHA1 Message Date
Noah Stapp
bbb6f88fae
PYTHON-5257 - Turn on mypy disallow_any_generics (#2456) 2025-08-06 14:21:53 -04:00
Noah Stapp
536b1cb8ab
PYTHON-5406 - AsyncPeriodicExecutor must reset CSOT contextvars befor… (#2360) 2025-06-06 13:17:36 -04:00
Jeffrey A. Clark
166821f22c
PYTHON-5205 Replace http with https in doc links (#2204) 2025-03-14 21:37:11 -04:00
Noah Stapp
b94dd8e12b
PYTHON-4745 - Test behavior of async task cancellation (#2136) 2025-02-10 16:50:40 -05:00
Noah Stapp
1b818470fc
PYTHON-5053 - AsyncMongoClient.close() should await all background tasks (#2127) 2025-02-05 15:05:41 -05:00
Noah Stapp
f1af917894
PYTHON-5044 - Fix successive AsyncMongoClients on a single loop always ti… (#2065) 2025-01-22 08:49:16 -05:00
Noah Stapp
0e8d70457f
Async client uses tasks instead of threads
PYTHON-4725 - Async client should use tasks for SDAM instead of threads
PYTHON-4860 - Async client should use asyncio.Lock and asyncio.Condition
PYTHON-4941 - Synchronous unified test runner being used in asynchronous tests
PYTHON-4843 - Async test suite should use a single event loop
PYTHON-4945 - Fix test cleanups for mongoses

Co-authored-by: Iris <58442094+sleepyStick@users.noreply.github.com>
2024-11-26 16:55:27 -05:00
Noah Stapp
d6bf0e1e78
PYTHON-4264 Async PyMongo Beta (#1629) 2024-06-06 09:01:24 -07:00
Jib
0f7e1b0110
PYTHON-4147: Silence noisy thread.start() RuntimeError at shutdown (#1486) 2024-02-05 08:46:32 -05:00
Steven Silvester
6537415da7
PYTHON-3605 Move type annotations to parameter list in rendered docs (#1441) 2023-11-27 09:24:00 -06:00
Iris
1adbc27b6f
PYTHON-3812 add types to periodic_executor.py (#1316) 2023-07-24 13:45: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
Ben Warner
3204290e93
PYTHON-2484 Added lock sanitization for MongoClient and ObjectId (#985) 2022-08-04 16:58:56 -07: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
dd6c140d43
PYTHON-3060 Add typings to pymongo package (#831) 2022-02-02 21:12:36 -06:00
Bernie Hackett
cf877e95c7 PYTHON-2503 Always use time.monotonic
For monotonic time needs.
2021-01-25 12:48:31 -08: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
5b49557c59 PYTHON-2268 Close clients in test suite 2020-06-03 17:05:59 -07:00
Prashant Mital
f85a9f9450
PYTHON-1675 SRV polling for mongos discovery 2019-06-10 12:51:49 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
A. Jesse Jiryu Davis
93fd58aa10 PYTHON-2014 - Topology.close fixes
Ensure a monitor thread is restarted by Topology.open if it exited with
an exception, set Topology._opened = False in Topology.close, and extend
the timeout in test_client_disconnect.
2017-04-02 20:35:01 -04:00
Shane Harvey
6bc48727de PYTHON-1177 Fix race condition in PeriodicExecutor 2016-11-04 14:06:33 -07:00
Andrey Gavrilin
f402c53348 Fix up shutdown for periodic executors 2016-07-11 13:08:36 -07:00
A. Jesse Jiryu Davis
9e6b66c499 PYTHON-1050 Rare RuntimeError during shutdown. 2016-01-30 12:51:51 -05:00
A. Jesse Jiryu Davis
e6457cdd3e PYTHON-983 Update docs for new executor design. 2015-10-15 00:37:39 -04:00
A. Jesse Jiryu Davis
4618998dd1 PYTHON-983 Idle monitor threads use excessive CPU. 2015-10-14 23:52:18 -04:00
Bernie Hackett
164cc34320 PYTHON-975 - Name our threads 2015-08-21 17:06:44 -07:00
A. Jesse Jiryu Davis
c226b4fb93 PYTHON-939 - AttributeError during shutdown.
I was treating a weakref.ref as if it were a weakref.proxy.
2015-06-16 20:28:59 -04:00
A. Jesse Jiryu Davis
06e7649da1 PYTHON-859 - Start dev guide with entry on PeriodicExecutor. 2015-06-15 20:40:49 -04:00
A. Jesse Jiryu Davis
a316c6576d PYTHON-939 - Stop background threads quicker.
Instead of signaling each thread to close, then waiting for it to finish
before signaling the next, instead signal all threads to close and let
them stop in parallel before joining any.

Additionally, spend less time holding strong references to threads.
2015-06-15 20:37:11 -04:00
A. Jesse Jiryu Davis
6547e1008b PYTHON-863 - Fix heartbeatFrequencyMS.
Had slept 10.5 seconds between checks instead of 10 seconds. Introduced in
previous commit.
2015-04-02 22:35:26 -04:00
A. Jesse Jiryu Davis
fa89e4ae38 PYTHON-863 - Don't take a lock from a weakref callback. 2015-04-02 16:12:05 -04:00
A. Jesse Jiryu Davis
5648745d0b PYTHON-863 - Ref cycle in Monitor. 2015-04-02 13:42:17 -04:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
1ab83f72cf PYTHON-799 Break ref cycle in Monitor.
Previous code to avoid the cycle was wrong.
2015-01-05 15:21:50 -05:00
A. Jesse Jiryu Davis
f0daebf4bb PYTHON-799 Create a PeriodicExecutor class for background monitoring.
The executor will also be used to solve a deadlock in Cursor.__del__.
2014-12-17 13:19:05 -05:00