argoproj / argo-cd

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

Implement graceful shutdown in all Argo CD components #18642

Open crenshaw-dev opened 4 months ago

crenshaw-dev commented 4 months ago

Procfile sets GOCOVDIR for five Argo CD components. But only one (applicationset-controller) shuts down gracefully enough for code coverage data to be produced. In other words, go writes a covmeta file, but not a covcounters file (the file that actually contains coverage info). So today we get partial code coverage info for e2e tests.

The task is to do two things for the remaining four components: 1) implement graceful shutdown and 2) add the component's gocov directory to the e2e reporting CI.

Exactly what "graceful shutdown means" may vary by component. Concretely, I think it means we need to listen to shutdown signals and end all running goroutines. But the "graceful" part depends on what's running.

leehosu commented 2 months ago

I'll fix the argocd-application-controller, I'll upload the PR soon.

leehosu commented 2 months ago

@crenshaw-dev Hi, crenshaw! Please check https://github.com/argoproj/argo-cd/pull/19368. If you have any problems, please let me know.