Skip to content

Commit

Permalink
remove handler.drop from defer
Browse files Browse the repository at this point in the history
Signed-off-by: AndreMouche <[email protected]>
  • Loading branch information
AndreMouche committed Jan 3, 2025
1 parent 9010bb4 commit d037400
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions txnkv/transaction/prewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,17 @@ func (action actionPrewrite) handleSingleBatch(
}

handler := action.newSingleBatchPrewriteReqHandler(c, batch, bo)
defer handler.drop(err)

var retryable bool
for {
// It will return false if the request is success or meet an unretryable error.
// otherwise if the error is retryable, it will return true.
retryable, err = handler.sendReqAndCheck()
if !retryable {
handler.drop(err)
return err
}
}

}

// handleSingleBatchFailpoint is used to inject errors for test.
Expand Down

0 comments on commit d037400

Please sign in to comment.