argoproj / argo-cd

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

fix: Memory leak in repo-server #20876

Closed AJChandler closed 20 hours ago

AJChandler commented 1 day ago

This resolves a memory leak in the repo-server during plugin discovery caused by the connection not being closed.

Repo-Server Goroutines Leak Screenshot 2024-11-20 at 3 21 32 PM

goroutine profile: total 1500
1458 @ 0x474eae 0x450a25 0x23d30ec 0x47d741
#   0x23d30eb   google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run+0x10b    /go/pkg/mod/google.golang.org/grpc@v1.66.2/internal/grpcsync/callback_serializer.go:88

Repo-Server Goroutines Leak - Hard Refresh Applications x2 Screenshot 2024-11-20 at 3 28 43 PM

goroutine profile: total 4842
3138 @ 0x474eae 0x450a25 0x23d30ec 0x47d741
#   0x23d30eb   google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run+0x10b    /go/pkg/mod/google.golang.org/grpc@v1.66.2/internal/grpcsync/callback_serializer.go:88

Fix Applied - Repo-Server Goroutines Leak - Hard Refresh Applications x2 Screenshot 2024-11-20 at 4 02 11 PM

Introduced by: #20196

Related improvement that would make this class of error harder to occur: #20217

This should be cherry-picked into the v2.13 release.

Checklist:

bunnyshell[bot] commented 1 day ago

:x: Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

codecov[bot] commented 1 day ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 55.04%. Comparing base (fc9b33b) to head (3b07c91). Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
util/app/discovery/discovery.go 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #20876 +/- ## ========================================== + Coverage 55.00% 55.04% +0.04% ========================================== Files 324 324 Lines 55398 55400 +2 ========================================== + Hits 30471 30497 +26 + Misses 22309 22279 -30 - Partials 2618 2624 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

crenshaw-dev commented 20 hours ago

/cherry-pick release-2.13