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:
@@ -146,14 +146,23 @@ func (h *sourceNameHandler) Process(ctx context.Context, source coredata.AccessR
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
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,
|
ctx,
|
||||||
"cannot load connector for source name sync",
|
"cannot set up name resolver, keeping generic name",
|
||||||
log.String("source_id", source.ID.String()),
|
log.String("source_id", source.ID.String()),
|
||||||
log.Error(err),
|
log.Error(err),
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
return h.markNameSynced(ctx, &source)
|
||||||
}
|
}
|
||||||
|
|
||||||
if resolver == nil {
|
if resolver == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user