diff --git a/go/libraries/doltcore/sqle/dprocedures/dolt_gc.go b/go/libraries/doltcore/sqle/dprocedures/dolt_gc.go index 4a28a3fe00..d4308e18bf 100644 --- a/go/libraries/doltcore/sqle/dprocedures/dolt_gc.go +++ b/go/libraries/doltcore/sqle/dprocedures/dolt_gc.go @@ -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 {