Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progressive sync constantly resyncs apps that need pruning #21528

Open
3 tasks done
Homulvas opened this issue Jan 16, 2025 · 3 comments · May be fixed by #21542
Open
3 tasks done

Progressive sync constantly resyncs apps that need pruning #21528

Homulvas opened this issue Jan 16, 2025 · 3 comments · May be fixed by #21542
Labels
appset/progressive-syncs Issues related to the ApplicationSet progressive syncs feature. bug Something isn't working component:application-sets Bulk application management related

Comments

@Homulvas
Copy link
Contributor

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

If an app has resources that need to be pruned and progressive sync is enabled the app will be moved to Waiting status which will start a sync that does nothing. After the sync finishes the same process repeats again causing infinite sync loop.

This line

appOutdated = syncStatusString == "OutOfSync"
appears to be the culprit here as it checks the App status and modifies it without checking if a sync would actually reconcile it.

To Reproduce

Create an appset with progressive sync.
Make a change that removes some resource.
Watch appset controller do the same thing over and over again.

Expected behavior

If the only App changes are resource removal and pruning is not enabled by default App shouldn't start syncing automatically.

Version

v2.13.1+af54ef8

Logs
appset controller logs:

end reconcile
Application test-argocd-c1-stg-main-001 moved to Pending status, watching for the Application to start Progressing
Application allowed to sync before maxUpdate?: map[test-argocd-c3-stg-main-001:false test-argocd-c1-stg-main-001:true test-argocd-c2-stg-main-001:false]
step 3: [test-argocd-c3-stg-main-001]
step 2: [test-argocd-c2-stg-main-001]
step 1: [test-argocd-c1-stg-main-001]
ApplicationSet test-argocd-staging-set step list:
Application test-argocd-c1-stg-main-001 is outdated, updating its ApplicationSet status to Waiting
generated 3 applications
end reconcile
triggering sync for application: test-argocd-c1-stg-main-001, prune enabled: false
Application allowed to sync before maxUpdate?: map[test-argocd-c3-stg-main-001:false test-argocd-c1-stg-main-001:true test-argocd-c2-stg-main-001:false]
step 3: [test-argocd-c3-stg-main-001]
step 2: [test-argocd-c2-stg-main-001]
step 1: [test-argocd-c1-stg-main-001]
ApplicationSet test-argocd-staging-set step list:
Application test-argocd-c1-stg-main-001 has completed a sync successfully, updating its ApplicationSet status to Progressing
generated 3 applications
end reconcile
Application test-argocd-c1-stg-main-001 moved to Pending status, watching for the Application to start Progressing
Application allowed to sync before maxUpdate?: map[test-argocd-c3-stg-main-001:false test-argocd-c1-stg-main-001:true test-argocd-c2-stg-main-001:false]
step 3: [test-argocd-c3-stg-main-001]
step 2: [test-argocd-c2-stg-main-001]
step 1: [test-argocd-c1-stg-main-001]
ApplicationSet test-argocd-staging-set step list:
Application test-argocd-c1-stg-main-001 is outdated, updating its ApplicationSet status to Waiting
generated 3 applications
@Homulvas Homulvas added the bug Something isn't working label Jan 16, 2025
@agaudreault agaudreault added component:application-sets Bulk application management related appset/progressive-syncs Issues related to the ApplicationSet progressive syncs feature. labels Jan 16, 2025
@agaudreault
Copy link
Member

Seems related to #21502

@Homulvas
Copy link
Contributor Author

Seems related to #21502

If I understand the issue description correctly it only happens once. Whereas in this case it triggers an infinite loop that blocks pretty much everything that is happening on the cluster.

@offzale
Copy link

offzale commented Jan 17, 2025

Seems related to #21502

If I understand the issue description correctly it only happens once. Whereas in this case it triggers an infinite loop that blocks pretty much everything that is happening on the cluster.

That is right, the sync happens only twice in that issue we are facing. Another issue where we are experiencing a sync loop is #21497, which might be different as we do not see any resources being synced after the Pre-Sync stage, and an app re-creation fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appset/progressive-syncs Issues related to the ApplicationSet progressive syncs feature. bug Something isn't working component:application-sets Bulk application management related
Projects
None yet
3 participants