Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pymongo/asynchronous/client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ def _max_time_expired_error(exc: PyMongoError) -> bool:


# From the transactions spec, all the retryable writes errors plus
# WriteConcernFailed.
# WriteConcernTimedOut.
_UNKNOWN_COMMIT_ERROR_CODES: frozenset = _RETRYABLE_ERROR_CODES | frozenset(
[
64, # WriteConcernFailed
64, # WriteConcernTimedOut
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should say WriteConcernTimeout.

50, # MaxTimeMSExpired
]
)
Expand Down
4 changes: 2 additions & 2 deletions pymongo/synchronous/client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,10 @@ def _max_time_expired_error(exc: PyMongoError) -> bool:


# From the transactions spec, all the retryable writes errors plus
# WriteConcernFailed.
# WriteConcernTimedOut.
_UNKNOWN_COMMIT_ERROR_CODES: frozenset = _RETRYABLE_ERROR_CODES | frozenset(
[
64, # WriteConcernFailed
64, # WriteConcernTimedOut
50, # MaxTimeMSExpired
]
)
Expand Down
3 changes: 1 addition & 2 deletions test/retryable_writes/unified/insertOne-serverErrors.json
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
]
},
{
"description": "InsertOne fails after WriteConcernError WriteConcernFailed",
"description": "InsertOne fails after WriteConcernError WriteConcernTimeout",
"operations": [
{
"name": "failPoint",
Expand All @@ -757,7 +757,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "waiting for replication timed out",
"errInfo": {
"wtimeout": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
],
"tests": [
{
"description": "commitTransaction is retried after WriteConcernFailed timeout error",
"description": "commitTransaction is retried after WriteConcernTimeout timeout error",
"operations": [
{
"name": "failPoint",
Expand All @@ -74,7 +74,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "waiting for replication timed out",
"errInfo": {
"wtimeout": true
Expand Down Expand Up @@ -236,7 +235,7 @@
]
},
{
"description": "commitTransaction is retried after WriteConcernFailed non-timeout error",
"description": "commitTransaction is retried after WriteConcernTimeout non-timeout error",
"operations": [
{
"name": "failPoint",
Expand All @@ -254,7 +253,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "multiple errors reported"
}
}
Expand Down
5 changes: 2 additions & 3 deletions test/transactions/unified/error-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@
]
},
{
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed",
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout",
"operations": [
{
"object": "testRunner",
Expand Down Expand Up @@ -1338,7 +1338,7 @@
]
},
{
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout",
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout",
"operations": [
{
"object": "testRunner",
Expand All @@ -1356,7 +1356,6 @@
],
"writeConcernError": {
"code": 64,
"codeName": "WriteConcernFailed",
"errmsg": "waiting for replication timed out",
"errInfo": {
"wtimeout": true
Expand Down
Loading