Skip to content

hydrator: Concurrency for the manifest hydration queue #27926

Description

@julianderks

First off, I'm a big fan of the Source Hydrator, and of the new GitOps Promoter. We're building a hub-spoke architecture across multiple clusters using the rendered-manifest pattern with gated promotions, and the two have been great to build on.

In that setup a single hub Argo CD instance hydrates the source repos for all the spokes, and hydration is starting to become a bottleneck, which is what this is about.

Summary

Hydration seems to process one source repo at a time. When commits land in several repos at once, the hydrations run sequentially rather than in parallel.

Could the concurrency of the hydration queue be made tunable? or, if it is meant to be sequential, what is the intended way to scale hydration as the number of source repos grows?

Motivation

We run a hub-spoke Argo CD topology: one hub Argo CD instance manages Applications across many spoke clusters. Each app has its own source repository, and we use the Source Hydrator together with GitOps Promoter for the rendered-manifest pattern with gated promotions between environments.

When commits land in many of those repos around the same time, for example a platform-wide change, or several teams pushing at once, hydration handles them one repo after another. As the number of apps and repos grows, this is becoming the limiting factor for how quickly changes become deployable.

Proposal

I don't know the Argo CD internals myself. An AI coding agent looked into the code and suggested a possible cause, I'm including it here as a lead for the maintainers, not as a confident diagnosis.

It pointed at the hydration queue being drained by a single goroutine in
controller/appcontroller.go:

go wait.Until(func() {
    for ctrl.processHydrationQueueItem() {}
}, time.Second, ctx.Done())

and noted that the status and operation queues are processed by a configurable number of workers (--status-processors / --operation-processors), while this one does not appear to be.

If that is the cause, a configurable processor count for the hydration queue might be one option. But there may be reasons it is sequential that I'm not aware of. I'd appreciate the maintainers' view on whether the current behaviour is intentional and what the right approach would be. Happy to test anything or help however is useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:hydratorIssue related to the Source Hydrator and commit serverenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions