File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2868,10 +2868,11 @@ async def run(self) -> T:
28682868 retryable_write_label = exc_to_check .has_error_label ("RetryableWriteError" )
28692869 overloaded = exc_to_check .has_error_label ("SystemOverloadedError" )
28702870 always_retryable = exc_to_check .has_error_label ("RetryableError" ) and overloaded
2871- if (
2872- not self ._client .options .retry_writes
2873- or not self ._retryable
2874- and not always_retryable
2871+
2872+ # Always retry abortTransaction and commitTransaction up to once
2873+ if not (self ._client .options .retry_writes and self ._retryable ) and (
2874+ not always_retryable
2875+ and self ._operation not in ["abortTransaction" , "commitTransaction" ]
28752876 ):
28762877 raise
28772878 if retryable_write_label or always_retryable :
Original file line number Diff line number Diff line change @@ -2858,10 +2858,11 @@ def run(self) -> T:
28582858 retryable_write_label = exc_to_check .has_error_label ("RetryableWriteError" )
28592859 overloaded = exc_to_check .has_error_label ("SystemOverloadedError" )
28602860 always_retryable = exc_to_check .has_error_label ("RetryableError" ) and overloaded
2861- if (
2862- not self ._client .options .retry_writes
2863- or not self ._retryable
2864- and not always_retryable
2861+
2862+ # Always retry abortTransaction and commitTransaction up to once
2863+ if not (self ._client .options .retry_writes and self ._retryable ) and (
2864+ not always_retryable
2865+ and self ._operation not in ["abortTransaction" , "commitTransaction" ]
28652866 ):
28662867 raise
28672868 if retryable_write_label or always_retryable :
You can’t perform that action at this time.
0 commit comments