argoproj / argo-cd

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

"Refresh apps" option only works in increments of 20 even when more workers are available #18165

Open RobinsonZ opened 3 weeks ago

RobinsonZ commented 3 weeks ago

Checklist:

Describe the bug

The web UI only submits requests in blocks of 20, and waits for all requests in that block to finish before launching another block of 20. This causes a mass refresh of applications to get stuck if any of the individual applications get stuck, and significantly slows the process down because if status-processors is set higher than the default then the UI won't use the maximum number of possible workers.

The relevant block of code seems to be here: https://github.com/argoproj/argo-cd/blob/653fc8da1f9c48cef535ff15e6ac7b5f795c9dae/ui/src/app/applications/components/applications-refresh-panel/applications-refresh-panel.tsx#L67-L70

To Reproduce

  1. Bring up an ArgoCD instance where argocd-application-controller has --status-processors set to a number higher than 20
  2. Create more than 20 apps
  3. From the web UI, click "refresh apps" and select all apps
  4. Click "refresh"

Expected behavior

One or both of the following:

  1. The applications are refreshed as fast as possible by submitting >20 requests at a time if the server can handle it.
  2. The UI doesn't wait for all requests in a block to finish before launching additional refresh requests.

Screenshots

Here's a screenshot of the network page during the refresh operation showing that the refresh requests are being fired in blocks of 20: image (URLs omitted from the screenshot since they contain company info, but these are all requests to refresh an app)

Version

argocd: v2.10.5+335875d
  BuildDate: 2024-03-28T16:12:55Z
  GitCommit: 335875d13e018bed6e03873f4742582582964745
  GitTreeState: clean
  GoVersion: go1.21.8
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.11.0+d3f33c0
  BuildDate: 2024-05-07T16:01:41Z
  GitCommit: d3f33c00197e7f1d16f2a73ce1aeced464b07175
  GitTreeState: clean
  GoVersion: go1.21.9
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.2.1 2023-10-19T20:13:51Z
  Helm Version: v3.14.3+gf03cc04
  Kubectl Version: v0.26.11
  Jsonnet Version: v0.20.0

(The shell is slightly out of date on the machine I'm submitting this from, but I didn't use the shell at all.)

Logs

N/A