Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in the upgrade action #10439

Closed
jkmw opened this issue Dec 6, 2021 · 1 comment · Fixed by #10440
Closed

Memory leak in the upgrade action #10439

jkmw opened this issue Dec 6, 2021 · 1 comment · Fixed by #10440
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@jkmw
Copy link
Contributor

jkmw commented Dec 6, 2021

During the upgrade action we noticed a memory leak which only occurs when helm is used as a "library" and not as a cli tool.

Actually, there are two places:

  1. The performUpgrade method waits at this point for the rChan, which is either filled by the releasingUpgrade or handleContext method. If the result comes from releasingUpgrade(), then handleContext() will wait until the context (ctx) is cancelled, which in most cases will never happen and keeps the routine running.

  2. If ctx is indeed cancelled, handleContext() calls reportToPerformUpgrade() which fills the already consumed rChan. However, this is never read because the only consumer (performUpgrade()) has already returned; The routine remains running forever.


Output of helm version:

version.BuildInfo{Version:"v3.7.1", GitCommit:"1d11fcb5d3f3bf00dbe6fe31b8412839a96b3dc4", GitTreeState:"clean", GoVersion:"go1.16.9"}
jkmw added a commit to jkmw/helm that referenced this issue Dec 6, 2021
jkmw added a commit to jkmw/helm that referenced this issue Dec 6, 2021
fixes helm#10439

Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
@yxxhero yxxhero added the bug Categorizes issue or PR as related to a bug. label Dec 7, 2021
mattfarina pushed a commit that referenced this issue Dec 7, 2021
fixes #10439

Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
(cherry picked from commit ad3d2cc)
zak905 pushed a commit to zak905/helm that referenced this issue Jan 19, 2023
fixes helm#10439

Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
@zhanghaohao
Copy link

zhanghaohao commented Feb 11, 2023

add #11805 as the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants