PYTHON-5510 Fix server selection log message for commitTransaction (#2503)

This commit is contained in:
Shane Harvey 2025-08-22 14:51:39 -07:00 committed by GitHub
parent e08284bdca
commit ddf9508e15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -167,7 +167,6 @@ from pymongo.errors import (
WTimeoutError,
)
from pymongo.helpers_shared import _RETRYABLE_ERROR_CODES
from pymongo.operations import _Op
from pymongo.read_concern import ReadConcern
from pymongo.read_preferences import ReadPreference, _ServerMode
from pymongo.server_type import SERVER_TYPE
@ -868,7 +867,7 @@ class AsyncClientSession:
return await self._finish_transaction(conn, command_name)
return await self._client._retry_internal(
func, self, None, retryable=True, operation=_Op.ABORT
func, self, None, retryable=True, operation=command_name
)
async def _finish_transaction(self, conn: AsyncConnection, command_name: str) -> dict[str, Any]:

View File

@ -165,7 +165,6 @@ from pymongo.errors import (
WTimeoutError,
)
from pymongo.helpers_shared import _RETRYABLE_ERROR_CODES
from pymongo.operations import _Op
from pymongo.read_concern import ReadConcern
from pymongo.read_preferences import ReadPreference, _ServerMode
from pymongo.server_type import SERVER_TYPE
@ -864,7 +863,9 @@ class ClientSession:
) -> dict[str, Any]:
return self._finish_transaction(conn, command_name)
return self._client._retry_internal(func, self, None, retryable=True, operation=_Op.ABORT)
return self._client._retry_internal(
func, self, None, retryable=True, operation=command_name
)
def _finish_transaction(self, conn: Connection, command_name: str) -> dict[str, Any]:
self._transaction.attempt += 1