Skip to content

Commit

Permalink
Merge pull request #8747 from dolthub/aaron/dolt_gc-safepoint-retry-q…
Browse files Browse the repository at this point in the history
…uery-cancel

go/libraries/doltcore/sqle/dprocedures: dolt_gc.go: Retry canceling running queries when waiting for safepoint establishment.
  • Loading branch information
reltuk authored Jan 16, 2025
2 parents 57effdc + 8706074 commit d2c94f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion go/libraries/doltcore/sqle/dprocedures/dolt_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,16 @@ func doDoltGC(ctx *sql.Context, args []string) (int, error) {
params.MaxElapsedTime = 3 * time.Second
err := backoff.Retry(func() error {
processes := ctx.ProcessList.Processes()
allgood := true
for _, p := range processes {
if _, ok := killed[p.Connection]; ok {
return errors.New("unable to establish safepoint.")
allgood = false
ctx.ProcessList.Kill(p.Connection)
}
}
if !allgood {
return errors.New("unable to establish safepoint.")
}
return nil
}, params)
if err != nil {
Expand Down

0 comments on commit d2c94f3

Please sign in to comment.