Skip to content

Commit 28392db

Browse files
Merge pull request #272 from sdcio/fixDryRUn
fix dryrun by existing for loop
2 parents 47f59a0 + 9fd0a3a commit 28392db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/datastore/transaction_rpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ func (d *Datastore) TransactionSet(ctx context.Context, transactionId string, tr
378378
defer d.dmutex.Unlock()
379379

380380
// Try to register the Transaction in the TransactionManager only a single transaction can be register (implicitly being active)
381+
outerloop:
381382
for {
382383
select {
383384
case <-ctx.Done():
@@ -389,7 +390,7 @@ func (d *Datastore) TransactionSet(ctx context.Context, transactionId string, tr
389390
transactionGuard, err = d.transactionManager.RegisterTransaction(ctx, transaction)
390391
if transactionGuard != nil {
391392
defer transactionGuard.Done()
392-
break
393+
break outerloop
393394
}
394395
return nil, ErrDatastoreLocked
395396
}

0 commit comments

Comments
 (0)