From 4d4a26cbbe994675551234b15953bd2cf27d6d8a Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 7 Apr 2025 11:34:01 -0700 Subject: [PATCH] PYTHON-5270 Server selection should log remainingTimeMS as milliseconds (#2263) --- 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 b315cc33b..32776bf7b 100644 --- a/pymongo/asynchronous/topology.py +++ b/pymongo/asynchronous/topology.py @@ -354,7 +354,7 @@ class Topology: 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 7df475b4c..df23bff28 100644 --- a/pymongo/synchronous/topology.py +++ b/pymongo/synchronous/topology.py @@ -354,7 +354,7 @@ class Topology: 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