From: Tom Clegg Date: Thu, 29 Jul 2021 03:45:23 +0000 (-0400) Subject: 17574: Fix misleading errors after reaching update limit. X-Git-Tag: 2.3.0~118^2~3 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/284a9a5515af712aff787ecc141d45c888fcef66 17574: Fix misleading errors after reaching update limit. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/services/keep-balance/collection.go b/services/keep-balance/collection.go index 575aa0c39c..1da3ec4415 100644 --- a/services/keep-balance/collection.go +++ b/services/keep-balance/collection.go @@ -163,7 +163,7 @@ func (bal *Balancer) updateCollections(ctx context.Context, c *arvados.Client, c txPending := 0 flush := func(final bool) error { err := tx.Commit() - if err != nil { + if err != nil && ctx.Err() == nil { tx.Rollback() return err } @@ -221,7 +221,7 @@ func (bal *Balancer) updateCollections(ctx context.Context, c *arvados.Client, c where uuid=$4`, repl, thresholdStr, classes, coll.UUID) if err != nil { - if err != context.Canceled { + if ctx.Err() == nil { bal.logf("%s: update failed: %s", coll.UUID, err) } continue