Skip to content

Commit

Permalink
fix: retry when conflict
Browse files Browse the repository at this point in the history
Signed-off-by: jiefenghuang <[email protected]>
  • Loading branch information
jiefenghuang committed Dec 26, 2024
1 parent 52625b4 commit ffd0a11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ func (m *dbMeta) shouldRetry(err error) bool {
logger.Warnf("transaction failed: %s, will retry it. please increase the max number of connections in your database, or use a connection pool.", msg)
return true
}
if strings.Contains(msg, "error 1020 (hy000)") {
return true
}
switch m.Name() {
case "sqlite3":
return errors.Is(err, errBusy) || strings.Contains(msg, "database is locked")
Expand Down

0 comments on commit ffd0a11

Please sign in to comment.