Skip to content

Commit

Permalink
don't retry operations that have conflict error
Browse files Browse the repository at this point in the history
If an operation receives a conflict error from the blockchain connector,
currently it will continutally retry submitting that operation but it will
never succeed. Instead, we shouldn't retry if we know the connector has
received the submission.
  • Loading branch information
shorsher committed Oct 30, 2024
1 parent 1939b67 commit 22629de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/batch/batch_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,11 @@ func (bp *batchProcessor) dispatchBatch(payload *DispatchPayload) error {
}
}
}
conflictErr, conflictTestOk := err.(operations.ConflictError)
if conflictTestOk && conflictErr.IsConflictError() {
// We know that the connector has received our batch, so we shouldn't need to retry
return true, nil
}
} else {
if core.IsPinned(payload.Batch.TX.Type) {
payload.addMessageUpdate(payload.Messages, core.MessageStateReady, core.MessageStateSent)
Expand Down

0 comments on commit 22629de

Please sign in to comment.