Skip to content

Argo CD

One fix in argoproj/argo-cd, maintained by Argo Project · CNCF.

Back to all open-source fixes

About Argo CD

Argo CD is a declarative GitOps continuous delivery tool for Kubernetes and a graduated CNCF project. It keeps applications running in a cluster in sync with the desired state stored in Git, and provides a web UI, CLI, and gRPC API for managing deployments, viewing resources, and streaming pod logs.

My work on it

My contribution to Argo CD is in the API server, focused on concurrency and resource safety in long-running streaming endpoints. I tracked down a goroutine leak in pod log streaming that grew argocd-server’s memory every time a user closed a log view mid-stream, and fixed it with a test that reproduces the leak without needing a cluster. The fix was merged in October 2026 and cherry-picked into the Argo CD 3.5 and 3.6 release branches.

Eliminating a goroutine leak in pod log streaming

The problem. When sending a log line to a disconnected client failed, the log-streaming goroutine wrote an error to a one-slot channel and then tried to send a second, final message. By then the handler had already returned, so nothing read that second message and the goroutine blocked forever. argocd-server leaked one goroutine, plus the stream it held, every time someone closed a log view while logs were still streaming. An earlier fix had tried to cover this path but assumed the goroutine only ever sent once.

The fix. Made the goroutine exit immediately after reporting the send error, matching how the other error path in the same loop already behaved.

How I tested it. Wrote a test that simulates a client disconnect and asserts no streaming goroutine is left running. It fails without the fix and passes consistently across repeated runs, along with the rest of the package.