Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ddf9508

Browse files
PYTHON-5510 Fix server selection log message for commitTransaction (#2503)
1 parent e08284b commit ddf9508

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎pymongo/asynchronous/client_session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
WTimeoutError,
168168
)
169169
from pymongo.helpers_shared import _RETRYABLE_ERROR_CODES
170-
from pymongo.operations import _Op
171170
from pymongo.read_concern import ReadConcern
172171
from pymongo.read_preferences import ReadPreference, _ServerMode
173172
from pymongo.server_type import SERVER_TYPE
@@ -868,7 +867,7 @@ async def func(
868867
return await self._finish_transaction(conn, command_name)
869868

870869
return await self._client._retry_internal(
871-
func, self, None, retryable=True, operation=_Op.ABORT
870+
func, self, None, retryable=True, operation=command_name
872871
)
873872

874873
async def _finish_transaction(self, conn: AsyncConnection, command_name: str) -> dict[str, Any]:

‎pymongo/synchronous/client_session.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@
165165
WTimeoutError,
166166
)
167167
from pymongo.helpers_shared import _RETRYABLE_ERROR_CODES
168-
from pymongo.operations import _Op
169168
from pymongo.read_concern import ReadConcern
170169
from pymongo.read_preferences import ReadPreference, _ServerMode
171170
from pymongo.server_type import SERVER_TYPE
@@ -864,7 +863,9 @@ def func(
864863
) -> dict[str, Any]:
865864
return self._finish_transaction(conn, command_name)
866865

867-
return self._client._retry_internal(func, self, None, retryable=True, operation=_Op.ABORT)
866+
return self._client._retry_internal(
867+
func, self, None, retryable=True, operation=command_name
868+
)
868869

869870
def _finish_transaction(self, conn: Connection, command_name: str) -> dict[str, Any]:
870871
self._transaction.attempt += 1

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /