From 89f8bd931a030ba08de6f4918ba33b3f8c674b37 Mon Sep 17 00:00:00 2001 From: MJ Palanker Date: Fri, 12 Sep 2025 12:42:55 -0700 Subject: [PATCH 1/2] swallow errors from targeted sync --- pkg/sync/syncer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/sync/syncer.go b/pkg/sync/syncer.go index c0d294db4..065763c11 100644 --- a/pkg/sync/syncer.go +++ b/pkg/sync/syncer.go @@ -493,7 +493,10 @@ func (s *syncer) Sync(ctx context.Context) error { continue } if !retryer.ShouldWaitAndRetry(ctx, err) { - return err + l.Error("max attempts reached for sync targeted resource action", zap.Any("stateAction", stateAction), zap.Error(err)) + // We want to continue here to make sure we finish other syncs + // we need a better solution for this. + continue } continue From b5e54c95cbbc3f1b6d9ecd859772db8ee49668dc Mon Sep 17 00:00:00 2001 From: MJ Palanker Date: Fri, 12 Sep 2025 12:50:45 -0700 Subject: [PATCH 2/2] better --- pkg/sync/syncer.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/sync/syncer.go b/pkg/sync/syncer.go index 065763c11..29ed0f775 100644 --- a/pkg/sync/syncer.go +++ b/pkg/sync/syncer.go @@ -492,12 +492,14 @@ func (s *syncer) Sync(ctx context.Context) error { s.state.FinishAction(ctx) continue } - if !retryer.ShouldWaitAndRetry(ctx, err) { - l.Error("max attempts reached for sync targeted resource action", zap.Any("stateAction", stateAction), zap.Error(err)) - // We want to continue here to make sure we finish other syncs - // we need a better solution for this. + if codes.Code(status.Code(err)) == codes.NotFound && s.syncType == connectorstore.SyncTypePartial { + l.Warn("sync targeted resource not found, continuing to sync other resources", zap.Any("stateAction", stateAction), zap.Error(err)) + s.state.FinishAction(ctx) continue } + if !retryer.ShouldWaitAndRetry(ctx, err) { + return err + } continue case SyncEntitlementsOp: