From 11e7a250fc8a03f0f9d12072742c9658aabc108b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Sibiril?= <81782+aureliensibiril@users.noreply.github.com> Date: Wed, 22 Jul 2026 14:37:02 +0200 Subject: [PATCH] Mark source synced when name resolver setup fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The source-name worker drains claims until ErrNoTask with no inter-task delay. When connector load or HTTP-client setup failed the worker logged an error and returned nil without marking the source synced, leaving name_synced_at NULL. The row stayed claimable, so a dead connector (notably a revoked OAuth refresh token failing the eager token refresh) was re-claimed immediately every cycle and hot- looped the vendor token endpoint. Treat a setup failure like a terminal resolution failure: keep the generic name and mark the source synced with a warning so it stops re-claiming. A later reconnect or reconfigure clears name_synced_at to retry. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com> --- pkg/accessreview/source_name_worker.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/accessreview/source_name_worker.go b/pkg/accessreview/source_name_worker.go index 2f2a248a9..8b10dc929 100644 --- a/pkg/accessreview/source_name_worker.go +++ b/pkg/accessreview/source_name_worker.go @@ -146,14 +146,23 @@ func (h *sourceNameHandler) Process(ctx context.Context, source coredata.AccessR }, ) if err != nil { - h.logger.ErrorCtx( + // Setting up the resolver failed: the connector is gone, its + // credentials cannot be decrypted, or an eager token refresh failed + // on a revoked OAuth refresh token. Returning nil without marking the + // source synced leaves name_synced_at NULL, so the worker re-claims + // the same row every drain cycle with no delay — a single dead + // connector then hot-loops the vendor token endpoint (millions of + // error logs in prod). Treat it as terminal: keep the generic name + // and mark the source synced so it stops re-claiming. A + // reconnect/reconfigure clears name_synced_at to try again. + h.logger.WarnCtx( ctx, - "cannot load connector for source name sync", + "cannot set up name resolver, keeping generic name", log.String("source_id", source.ID.String()), log.Error(err), ) - return nil + return h.markNameSynced(ctx, &source) } if resolver == nil {