Commit Graph

33 Commits

Author SHA1 Message Date
Steven Silvester
474420b2e5
PYTHON-3085 Audit consistent and correct types for _DocumentOut (#893) 2022-03-16 05:56:07 -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
dd6c140d43
PYTHON-3060 Add typings to pymongo package (#831) 2022-02-02 21:12:36 -06:00
Shane Harvey
b342990934
PYTHON-2164 Add MongoClient.options, remove redundant properties (#772) 2021-11-03 11:21:33 -07:00
Shane Harvey
f4eb8f93fd
PYTHON-2966 Make MongoClient.event_listeners work as expected (#761) 2021-10-22 14:43:20 -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
3e02957998 PYTHON-2288 Finish removing IsMaster from docs 2021-08-06 12:33:26 -07:00
Shane Harvey
01e34cebdb
PYTHON-2769 Test redaction of replies to security-sensitive commands (#676)
Resync command monitoring and unified test format tests.
Redact entire hello response when the command started contained speculativeAuthenticate.
Make OP_REPLY cursor.cursor_id always be an Int64.
2021-07-15 14:12:11 -07:00
Prashant Mital
59dc6d8ca0
PYTHON-2718 Test redaction of security sensitive command monitoring events (#637) 2021-06-21 18:07:28 -07:00
Shane Harvey
c8f32a7a37 PYTHON-2673 Connection pinning behavior for load balanced clusters (#630)
Tweak spec test because pymongo unpins cursors eagerly after errors.
Tweak spec test for PoolClearedEvent ordering when MongoDB handshake fails (see DRIVERS-1785).
Only skip killCursors for some error codes.
Rely on SDAM error handling to close the connection after a state change error.
Add service_id to various events.
Retain reference to pinned sockets to prevent premptive closure by CPython's cyclic GC.
2021-06-15 14:14:56 -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
Bernie Hackett
6c2d629006 PYTHON-2133 Remove Py2 compatibility from pymongo 2021-01-19 21:15:20 -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
Julius Park
f80c82453b
PYTHON-2076: Add example event loggers (#449)
Added example event loggers and documentation for them to make it easier for users to start using listeners in their code.
JIRA ticket: https://jira.mongodb.org/browse/PYTHON-2076
2020-07-09 21:32:25 -04:00
Shane Harvey
1c29c1a65e
PYTHON-2299 Add the "awaited" field to heartbeat events (#457) 2020-07-08 14:02:34 -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
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
Bernie Hackett
749c1a2f0b PYTHON-1467 - PyMongo no longer supports Python 2.6 2018-07-02 15:15:43 -07:00
Bernie Hackett
ba7c95a9df PYTHON-1462 - Import ABCs from collections.abc 2018-02-12 19:42:44 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Shane Harvey
9468c119a3 PYTHON-1335 Improve __slots__ usage.
__slots__ must be defined in all classes in the hierarchy to avoid __dict__
and __weakref__ overhead.
2017-08-03 14:57:43 -07:00
Bernie Hackett
eb7f2e625a PYTHON-1138 - Improve SDAM monitoring documentation 2016-09-01 17:49:30 -07:00
Bernie Hackett
7afca2faa9 PYTHON-1067 - Minor doc fixes 2016-06-14 11:32:24 -07:00
aherlihy
d98a745700 PYTHON-1067 - Implement SDAM Monitoring 2016-06-14 15:20:19 +02:00
aherlihy
10608144d6 PYTHON-658 - Support minPoolSize, maxIdleTimeMS 2016-06-14 14:37:06 +02:00
Bernie Hackett
101f704744 PYTHON-952 - Redact command and reply documents for sensitive commands 2015-10-11 14:19:16 -07:00
Bernie Hackett
28885b25e8 PYTHON-952 - API improvements
This commit implements the following simplifications and improvements:

- The Subscriber ABC has been renamed to CommandListener
- The subscribe function has been renamed to register
- The COMMAND constant has been removed
- The get_subscribers function has been removed
- Command listeners can now be registered per MongoClient instance
  instead of just globally
2015-10-09 17:03:51 -07:00
Luke Lovett
b6182d0587 PYTHON-976 - Publish a CommandFailedEvent for arbitrary failures. 2015-10-07 11:08:05 -07:00
Bernie Hackett
b80fa6d632 PYTHON-952 - Bulk write operations monitoring
This change adds monitoring of bulk write operations (i.e.
Collection.bulk_write, Collection.insert_many, Collection.insert with multiple
documents, Bulk.execute, etc.). It also fixes bugs in conversion of legacy
write results to write command result format and conversion of legacy queries
to find command documents. Finally, it adds an operation_id attribute to the
published events to tie related events together.
2015-09-10 09:10:19 -07:00
Bernie Hackett
fa4a6a39d3 PYTHON-952 - Query and getMore monitoring
This commit adds support for monitoring queries and getMore
operations, including getMore operations for command cursors
(e.g. aggregate cursor getMore). It also fixes a bug in duration
calculation.
2015-08-11 12:19:28 -07:00
Bernie Hackett
f0a85a4869 PYTHON-952 - Basic command monitoring
This commit adds support for publishing events when commands
(ismaster, findAndModify, listCollections, etc.) start and
succeed or fail. See the new module, pymongo.monitoring, for
details.

This commit only adds basic infrastructure and support for
monitoring generic commands. Support for monitoring queries,
getMores, killCursors, and write operations are forthcoming.
2015-08-11 11:39:03 -07:00