File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,8 @@ func (op Operation) Execute(ctx context.Context, scratch []byte) error {
384
384
connDesc := conn .Description ()
385
385
retryableErr := tt .Retryable (connDesc .WireVersion )
386
386
preRetryWriteLabelVersion := connDesc .WireVersion != nil && connDesc .WireVersion .Max < 9
387
- inTransaction := ! (op .Client .Committing || op .Client .Aborting ) && op .Client .TransactionRunning ()
387
+ inTransaction := op .Client != nil &&
388
+ ! (op .Client .Committing || op .Client .Aborting ) && op .Client .TransactionRunning ()
388
389
// If retry is enabled and the operation isn't in a transaction, add a RetryableWriteError label for
389
390
// retryable errors from pre-4.4 servers
390
391
if retryableErr && preRetryWriteLabelVersion && retryEnabled && ! inTransaction {
@@ -465,7 +466,8 @@ func (op Operation) Execute(ctx context.Context, scratch []byte) error {
465
466
if op .Type == Write {
466
467
retryableErr = tt .RetryableWrite (connDesc .WireVersion )
467
468
preRetryWriteLabelVersion := connDesc .WireVersion != nil && connDesc .WireVersion .Max < 9
468
- inTransaction := ! (op .Client .Committing || op .Client .Aborting ) && op .Client .TransactionRunning ()
469
+ inTransaction := op .Client != nil &&
470
+ ! (op .Client .Committing || op .Client .Aborting ) && op .Client .TransactionRunning ()
469
471
// If retryWrites is enabled and the operation isn't in a transaction, add a RetryableWriteError label
470
472
// for network errors and retryable errors from pre-4.4 servers
471
473
if retryEnabled && ! inTransaction &&
You can’t perform that action at this time.
0 commit comments