From 284a9a5515af712aff787ecc141d45c888fcef66 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 28 Jul 2021 23:45:23 -0400 Subject: [PATCH] 17574: Fix misleading errors after reaching update limit. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- services/keep-balance/collection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.30.2