Mark source synced when name resolver setup fails

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>
This commit is contained in:
Aurélien Sibiril
2026-07-22 14:37:02 +02:00
parent 94552dbf11
commit 11e7a250fc

View File

@@ -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 {