PYTHON-5741 - Transaction state is preserved across retries (#2718)
This commit is contained in:
parent
e7a5247bed
commit
359ddfaad7
@ -894,15 +894,16 @@ class AsyncMongoClient(common.BaseObject, Generic[_DocumentType]):
|
||||
self._options.read_concern,
|
||||
)
|
||||
|
||||
self._retry_policy = _RetryPolicy(
|
||||
_TokenBucket(), adaptive_retry=self._options.adaptive_retries
|
||||
)
|
||||
|
||||
self._init_based_on_options(self._seeds, srv_max_hosts, srv_service_name)
|
||||
|
||||
self._opened = False
|
||||
self._closed = False
|
||||
self._loop: Optional[asyncio.AbstractEventLoop] = None
|
||||
|
||||
self._retry_policy = _RetryPolicy(
|
||||
_TokenBucket(), adaptive_retry=self._options.adaptive_retries
|
||||
)
|
||||
if not is_srv:
|
||||
self._init_background()
|
||||
|
||||
|
||||
@ -894,15 +894,16 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
|
||||
self._options.read_concern,
|
||||
)
|
||||
|
||||
self._retry_policy = _RetryPolicy(
|
||||
_TokenBucket(), adaptive_retry=self._options.adaptive_retries
|
||||
)
|
||||
|
||||
self._init_based_on_options(self._seeds, srv_max_hosts, srv_service_name)
|
||||
|
||||
self._opened = False
|
||||
self._closed = False
|
||||
self._loop: Optional[asyncio.AbstractEventLoop] = None
|
||||
|
||||
self._retry_policy = _RetryPolicy(
|
||||
_TokenBucket(), adaptive_retry=self._options.adaptive_retries
|
||||
)
|
||||
if not is_srv:
|
||||
self._init_background()
|
||||
|
||||
|
||||
@ -412,17 +412,31 @@
|
||||
"events": [
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"commandName": "insert"
|
||||
"command": {
|
||||
"startTransaction": true
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "transaction-tests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"commandName": "insert"
|
||||
"command": {
|
||||
"startTransaction": true
|
||||
},
|
||||
"commandName": "insert",
|
||||
"databaseName": "transaction-tests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"commandStartedEvent": {
|
||||
"commandName": "abortTransaction"
|
||||
"command": {
|
||||
"startTransaction": {
|
||||
"$$exists": false
|
||||
}
|
||||
},
|
||||
"commandName": "abortTransaction",
|
||||
"databaseName": "admin"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user