From 6f4040ba258314c5bd4f0ffa57cabe42d946287d Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 4 Apr 2025 16:00:03 -0700 Subject: [PATCH] PYTHON-5270 Server selection should log remainingTimeMS as milliseconds --- pymongo/asynchronous/topology.py | 2 +- pymongo/synchronous/topology.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pymongo/asynchronous/topology.py b/pymongo/asynchronous/topology.py index b315cc33b7..32776bf7b9 100644 --- a/pymongo/asynchronous/topology.py +++ b/pymongo/asynchronous/topology.py @@ -354,7 +354,7 @@ async def _select_servers_loop( operationId=operation_id, topologyDescription=self.description, clientId=self.description._topology_settings._topology_id, - remainingTimeMS=int(end_time - time.monotonic()), + remainingTimeMS=int(1000 * (end_time - time.monotonic())), ) logged_waiting = True diff --git a/pymongo/synchronous/topology.py b/pymongo/synchronous/topology.py index 7df475b4c8..df23bff28c 100644 --- a/pymongo/synchronous/topology.py +++ b/pymongo/synchronous/topology.py @@ -354,7 +354,7 @@ def _select_servers_loop( operationId=operation_id, topologyDescription=self.description, clientId=self.description._topology_settings._topology_id, - remainingTimeMS=int(end_time - time.monotonic()), + remainingTimeMS=int(1000 * (end_time - time.monotonic())), ) logged_waiting = True