Details
-
Bug
-
Status: Closed
-
Minor - P4
-
Resolution: Fixed
-
3.1, 3.2, 3.3, 3.4
-
None
-
Minor Change
Description
killCursors events for MongoDB >= 3.2 publish connection_id as an instance of tuple. For MongoDB < 3.2 connection_id is published as an internal type, _CursorAddress, a subclass of tuple with an extra attribute.
This was uncovered by a test failure under Jython, which appears to consider exact subclass in comparisons:
======================================================================
|
FAIL: test_kill_cursors (test.test_monitoring.TestCommandMonitoring)
|
----------------------------------------------------------------------
|
Traceback (most recent call last):
|
File "test/test_monitoring.py", line 508, in test_kill_cursors
|
self.assertEqual(cursor.address, started.connection_id)
|
AssertionError: (u'localhost', 27017) != (u'localhost', 27017)
|
We'll fix this by always publishing a tuple, rather than the subclass, to match the rest of the monitoring API. This change could be a backward breaking change for some application somewhere (though that's extremely unlikely).