[direct: mongos] ggt> db.version() 6.0.4 (myproj) ~/tmp$ python -V Python 3.9.16 (myproj) ~/tmp$ pip freeze | grep pymongo pymongo==4.3.3 (myproj) ~/tmp$ cat ./test_with_logging.py import pymongo, os, time, traceback from pymongo.server import Server from pymongo.pool import SocketInfo from pymongo.message import _OpMsg def add_logging(fn): def f(*args, **kwargs): print(f'[{int(time.time())}] {fn} called with ({args=}, {kwargs=})') try: res = fn(*args, **kwargs) res_repr = repr(res) if isinstance(res, _OpMsg): res_repr = f'_OpMsg({res.flags}, {res.payload_document.tobytes()})' print(f'[{int(time.time())}] returning {res_repr}') return res except Exception as e: print(f'[{int(time.time())}] exception {traceback.format_exc()=}') raise return f Server.run_operation = add_logging(Server.run_operation) SocketInfo.receive_message = add_logging(SocketInfo.receive_message) SocketInfo.send_message = add_logging(SocketInfo.send_message) db = pymongo.MongoClient(os.environ['DB_URL']) q = db.ggt.block_ts.find({ '$and': [{'metadata.chain_id': 42161, 'block_n': {'$gte': 62000000, '$lte': 67000000}}], }) #print(q.explain()) # just an index scan for i, row in enumerate(q): print((i, time.time())) if i > 150: break ## Please let me know if I've inadvertently exposed any IP address or credentials! (myproj) ~/tmp$ python ./test_with_logging.py | tee out.log ; date +%s [1679246071] called with (args=(.us-east-2.elb.amazonaws.com', 27017) server_type: Mongos, rtt: 0.24396078661084175>>, SocketInfo(', 45632), raddr=('', 27017)>) at 140283787930064, , Primary(), , >), kwargs={}) [1679246071] called with (args=(SocketInfo(', 45632), raddr=('', 27017)>) at 140283787930064, b'\x1d\x01\x00\x00\xff\\I\x19\x00\x00\x00\x00\xdd\x07\x00\x00\x00\x00\x00\x00\x00\x08\x01\x00\x00\x02find\x00\t\x00\x00\x00block_ts\x00\x03filter\x00Q\x00\x00\x00\x04$and\x00F\x00\x00\x00\x030\x00>\x00\x00\x00\x10metadata.chain_id\x00\xb1\xa4\x00\x00\x03block_n\x00\x19\x00\x00\x00\x10$gte\x00\x80\x0b\xb2\x03\x10$lte\x00\xc0V\xfe\x03\x00\x00\x00\x00\x03lsid\x00\x1e\x00\x00\x00\x05id\x00\x10\x00\x00\x00\x041Y\x9cb\xbf\x00E}\xb0\xb0=\xa2/m5\x1a\x00\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x05\x00\x00\x00\xf6B\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00D\xec\xec\xad\xd0\xaf\xddb\xf0\xa1\tM\x81MF\x19|\xee\\*\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x02$db\x00\x04\x00\x00\x00ggt\x00\x00', 264), kwargs={}) [1679246071] returning None [1679246071] called with (args=(SocketInfo(', 45632), raddr=('', 27017)>) at 140283787930064, 424238335), kwargs={}) [1679246071] returning _OpMsg(0, b"\x13A\x00\x00\x03cursor\x00}@\x00\x00\x04firstBatch\x00K@\x00\x00\x030\x00\x9f\x00\x00\x00\x07_id\x00c\xf0b[\xff\xa8\xa5\x9e<\xc5\x8e\xba\x03metadata\x00X\x00\x00\x00\x02type\x00\x10\x00\x00\x00block_timestamp\x00\x02source\x00\x0b\x00\x00\x00blockchain\x00\x10chain_id\x00\xb1\xa4\x00\x00\x02chain\x00\t\x00\x00\x00arbitrum\x00\x00\x10log_ts\x00[b\xf0c\x10block_ts\x00[b\xf0c\x10block_n\x00\x80\x0b\xb2\x03\x00\x031\x00\x9f\x00\x00\x00\x07_id\x00c\xf0b[\xff\xa8\xa5\x9e<\xc5\x8e\xbb\x03metadata\x00X\x00\x00\x00\x02type\x00\x10\x00\x00\x00block_timestamp\x00\x02source\x00\x0b\x00\x00\x00blockchain\x00\x10chain_id\x00\xb1\xa4\x00\x00\x02chain\x00\t\x00\x00\x00arbitrum\x00\x00\x10log_ts\x00[b\xf0c\x10block_ts\x00[b\xf0c\x10block_n\x00\x81\x0b\xb2\x03\x00\x032\x00\x9f\x00\x00\x00\x07_id\x00c\xf0b[\xff\xa8\xa5\x9e<\xc5\x8e\xbd\x03metadata\x00X\x00\x00\x00\x02type\x00\x10\x00\x00\x00block_timestamp\x00\x02source\x00\x0b\x00\x00\x00blockchain\x11operationTime\x00\x04\x00\x00\x00\xf7B\x17d\x00") [1679246071] returning (0, 1679246071.8731527) (1, 1679246071.873166) (2, 1679246071.8731704) (3, 1679246071.8731744) (4, 1679246071.8731785) (5, 1679246071.873182) (6, 1679246071.8731856) (7, 1679246071.873189) (8, 1679246071.8731925) (9, 1679246071.8731961) (10, 1679246071.8731997) (11, 1679246071.8732035) (12, 1679246071.873207) (13, 1679246071.8732314) (14, 1679246071.873235) (15, 1679246071.873239) (16, 1679246071.8732426) (17, 1679246071.8732462) (18, 1679246071.8732498) (19, 1679246071.8732574) (20, 1679246071.8732612) (21, 1679246071.8732646) (22, 1679246071.8732681) (23, 1679246071.8732717) (24, 1679246071.873275) (25, 1679246071.8732796) (26, 1679246071.8732831) (27, 1679246071.8732867) (28, 1679246071.8732903) (29, 1679246071.8732939) (30, 1679246071.8732975) (31, 1679246071.8733015) (32, 1679246071.8733053) (33, 1679246071.8733087) (34, 1679246071.8733122) (35, 1679246071.8733158) (36, 1679246071.8733194) (37, 1679246071.8733237) (38, 1679246071.8733273) (39, 1679246071.8733308) (40, 1679246071.8733346) (41, 1679246071.8733382) (42, 1679246071.8733413) (43, 1679246071.8733451) (44, 1679246071.8733482) (45, 1679246071.8733523) (46, 1679246071.8733559) (47, 1679246071.8733594) (48, 1679246071.873363) (49, 1679246071.8733668) (50, 1679246071.8733704) (51, 1679246071.8733737) (52, 1679246071.873377) (53, 1679246071.8733814) (54, 1679246071.873385) (55, 1679246071.8733883) (56, 1679246071.8733919) (57, 1679246071.8733952) (58, 1679246071.8733988) (59, 1679246071.8734024) (60, 1679246071.8734057) (61, 1679246071.8734093) (62, 1679246071.8734128) (63, 1679246071.8734167) (64, 1679246071.8734202) (65, 1679246071.8734236) (66, 1679246071.8734272) (67, 1679246071.8734305) (68, 1679246071.873434) (69, 1679246071.8734374) (70, 1679246071.873441) (71, 1679246071.8734443) (72, 1679246071.873448) (73, 1679246071.8734515) (74, 1679246071.873455) (75, 1679246071.8734584) (76, 1679246071.873462) (77, 1679246071.8734653) (78, 1679246071.8734689) (79, 1679246071.8734725) (80, 1679246071.8734758) (81, 1679246071.8734794) (82, 1679246071.873483) (83, 1679246071.8734863) (84, 1679246071.8734899) (85, 1679246071.8734934) (86, 1679246071.873497) (87, 1679246071.8735003) (88, 1679246071.873504) (89, 1679246071.8735075) (90, 1679246071.8735108) (91, 1679246071.8735144) (92, 1679246071.8735178) (93, 1679246071.8735213) (94, 1679246071.873525) (95, 1679246071.8735282) (96, 1679246071.8735318) (97, 1679246071.8735352) (98, 1679246071.8735387) (99, 1679246071.8735423) (100, 1679246071.873546) [1679246071] called with (args=(.us-east-2.elb.amazonaws.com', 27017) server_type: Mongos, rtt: 0.24396078661084175>>, SocketInfo(', 45632), raddr=('', 27017)>) at 140283787930064, , Primary(), , >), kwargs={}) [1679246071] called with (args=(SocketInfo(', 45632), raddr=('', 27017)>) at 140283787930064, b'\xdb\x00\x00\x00J\x94\xe8*\x00\x00\x00\x00\xdd\x07\x00\x00\x00\x00\x00\x00\x00\xc6\x00\x00\x00\x12getMore\x00cf\xb9\x1b5\x03\xa1h\x02collection\x00\t\x00\x00\x00block_ts\x00\x03lsid\x00\x1e\x00\x00\x00\x05id\x00\x10\x00\x00\x00\x041Y\x9cb\xbf\x00E}\xb0\xb0=\xa2/m5\x1a\x00\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x04\x00\x00\x00\xf7B\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xdd\x8c\x8eRS\xe6\x83\x9dR\xed\x9d\x82\x90Hs\xa9\xc0M\x17\xa1\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x02$db\x00\x04\x00\x00\x00ggt\x00\x00', 198), kwargs={}) [1679246071] returning None [1679246071] called with (args=(SocketInfo(', 45632), raddr=('', 27017)>) at 140283787930064, 719885386), kwargs={}) [1679246080] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246090] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00Q\xe1\xdd\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x04\x00\x00\x00\nC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xfd\xff\xcc\xdc\xa3\x01\xf9\t\n}H\xe8\x1dM\xdd\xf41U\x18\xd2\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x04\x00\x00\x00\nC\x17d\x00') [1679246090] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246100] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00b\x08\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x1e\x00\x00\x00\x14C\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xf5\xdc\xa2\xd5\x9d\xc3\xb8!\x90\xb4\xaa\xd5~<"\x95\x9fM\xc8\xc0\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x1e\x00\x00\x00\x14C\x17d\x00') [1679246100] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246110] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00{/\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x04\x00\x00\x00\x1eC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00>\x95Iz\xe5\xd1\xd3\x17\xddq{\xaaV\x84\x0f\x7fvC!\t\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x04\x00\x00\x00\x1eC\x17d\x00') [1679246110] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246120] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\x94V\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x0f\x00\x00\x00(C\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xfe\x91\x9d*P\x9a\xab\xda\xdf\xfe\xdb\x80 called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246130] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\xac}\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x07\x00\x00\x002C\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00Iwj\xac\x9fK^\xebVu\x1e\x04\x84\xe0ca\xa8^\xbd"\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x07\x00\x00\x002C\x17d\x00') [1679246130] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246140] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\xc2\xa4\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x03\x00\x00\x00 called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246150] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\xd3\xcb\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\xb0\x00\x00\x00FC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\x1d\xd5n\x82P(e\x9d\x94\xa0\xf6"u\x94\xfcP\xbbY\xa1\x93\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\xb0\x00\x00\x00FC\x17d\x00') [1679246150] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246160] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\xe8\xf2\xde\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x03\x00\x00\x00PC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\x8d\xe9U\xb5Ms\xba}\x8e\x9b\xaa\x8cq\xd21\x8e\xf6\x80\xed\x07\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x03\x00\x00\x00PC\x17d\x00') [1679246160] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246170] returning _OpMsg(2, b"\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\x00\x1a\xdf\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x1a\x00\x00\x00ZC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\x11y@\xb5\x97:\xa2\xe8\xe6\xe2|'\xea\xd9\x14\x91\x18\x9a\x0f\xb1\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x1a\x00\x00\x00ZC\x17d\x00") [1679246170] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246180] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\x18A\xdf\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x03\x00\x00\x00dC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00`\xe2\xca^4\t\xc5g\x9a\xd4\xb0\xc3\x0bm\xb7y\xca\xc7xL\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x03\x00\x00\x00dC\x17d\x00') [1679246180] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246190] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00.h\xdf\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x03\x00\x00\x00nC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00?S\xe1\xe9\x92\xe9\xb6;\xa8\xbe\\ZT\x9d\xb0(awm\x0e\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x03\x00\x00\x00nC\x17d\x00') [1679246190] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246200] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00D\x8f\xdf\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00a\x00\x00\x00xC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xe4\xc0\x14.\xb3|D?\xa6\xaa\x14\xb0kxc\x87Cm\xdf|\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00a\x00\x00\x00xC\x17d\x00') [1679246200] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246210] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\\\xb6\xdf\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x06\x00\x00\x00\x82C\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xbc\xea\xf8N\xe2\xa3\x90\xb7\xd3O\t\\F\x00Ye\x03TO\xe4\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x06\x00\x00\x00\x82C\x17d\x00') [1679246210] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246220] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00v\xdd\xdf\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x06\x00\x00\x00\x8cC\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xdc>]\xbb\xac1\xd2\xfe\x8a\xc7\xf9n\x13x\xa9J$:\xc2\xd6\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x06\x00\x00\x00\x8cC\x17d\x00') [1679246220] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) [1679246230] returning _OpMsg(2, b'\xa8\x01\x00\x00\x08isWritablePrimary\x00\x01\x02msg\x00\t\x00\x00\x00isdbgrid\x00\x03topologyVersion\x00-\x00\x00\x00\x07processId\x00d\x10\xa1\xbb\x98\x9cf\xc3\x865\xf4z\x12counter\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10maxBsonObjectSize\x00\x00\x00\x00\x01\x10maxMessageSizeBytes\x00\x00l\xdc\x02\x10maxWriteBatchSize\x00\xa0\x86\x01\x00\tlocalTime\x00\x8e\x04\xe0\xfa\x86\x01\x00\x00\x10logicalSessionTimeoutMinutes\x00\x1e\x00\x00\x00\x10connectionId\x00\x05\xcb\x04\x00\x10maxWireVersion\x00\x11\x00\x00\x00\x10minWireVersion\x00\x00\x00\x00\x00\x01ok\x00\x00\x00\x00\x00\x00\x00\xf0?\x03$clusterTime\x00X\x00\x00\x00\x11clusterTime\x00\x06\x00\x00\x00\x96C\x17d\x03signature\x003\x00\x00\x00\x05hash\x00\x14\x00\x00\x00\x00\xb5\x9dO\xe4\xb2#\x89\xf5\xdeq\xc1\xba\xc7\xd2\xb4\xbaD\xaf\xa5\x12\x12keyId\x00\x19\x00\x00\x00\xaa\xa1\x10d\x00\x00\x11operationTime\x00\x06\x00\x00\x00\x96C\x17d\x00') [1679246230] called with (args=(SocketInfo(', 50490), raddr=('', 27017)>) at 140283787928480, None), kwargs={}) ^CTraceback (most recent call last): File "/home/me/tmp/./test.py", line 31, in for i, row in enumerate(q): File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/cursor.py", line 1248, in next if len(self.__data) or self._refresh(): File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/cursor.py", line 1188, in _refresh self.__send_message(g) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/cursor.py", line 1052, in __send_message response = client._run_operation( File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/_csot.py", line 105, in csot_wrapper return func(self, *args, **kwargs) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1330, in _run_operation return self._retryable_read( File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/_csot.py", line 105, in csot_wrapper return func(self, *args, **kwargs) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1448, in _retryable_read return func(session, server, sock_info, read_pref) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1326, in _cmd return server.run_operation( File "/home/me/tmp/./test.py", line 10, in f res = fn(*args, **kwargs) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/server.py", line 115, in run_operation reply = sock_info.receive_message(request_id) File "/home/me/tmp/./test.py", line 10, in f res = fn(*args, **kwargs) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/pool.py", line 821, in receive_message self._raise_connection_failure(error) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/pool.py", line 819, in receive_message return receive_message(self, request_id, self.max_message_size) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/network.py", line 238, in receive_message data = _receive_data_on_socket(sock_info, length - 16, deadline) File "/home/me/mambaforge/envs/myproj/lib/python3.9/site-packages/pymongo/network.py", line 299, in _receive_data_on_socket chunk_length = sock_info.sock.recv_into(mv[bytes_read:]) KeyboardInterrupt Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> BrokenPipeError: [Errno 32] Broken pipe