argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.07k stars 5.53k forks source link

Application should be refreshed in-between sync retries #12904

Open jannfis opened 1 year ago

jannfis commented 1 year ago

Summary

When a sync fails for some reason, and retry is enabled, the Application should be refreshed in between the sync retries instead of re-using the same sync context for each retry.

Motivation

When auto-sync is enabled, a sync that runs with retries enabled may take a long time to complete if there is some kind of unrecoverable error (for example, an erroneous manifest), even if it is already fixed at the source. Even if Argo CD receives a refresh in the time the broken sync is running in its retry-loop, it won't consider any new changes in the repository, ultimately failing auto-sync until the next commit or manual refresh of the application.

Similarly, if self-heal is enabled, the following situation can occur:

Proposal

With sync retries enabled, Argo CD should perform a refresh and update of its sync-context on sync error before proceeding to the next tries. It should:

oscrx commented 1 year ago

I think this is related to the issue I reported earlier #10303

jannfis commented 1 year ago

@oscrx Yep. It seems to be very related. Thanks for linking.