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

fix yurthub memory leak #1501

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

JameKeal
Copy link
Member

@JameKeal JameKeal commented May 29, 2023

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind bug

What this PR does / why we need it:

When yurthub connect with pool-coordinator etcd failed, and keep try again, the goroutine of grpc is increase all the while, and memory of yurthub also increase, and kubelet will restart it when is happen OOM.
0efec082db7f88f00fa4934ba4ba366

e50ee49fda9b174b93760f01bf9c10e

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@JameKeal: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind bug

What this PR does / why we need it:

When yurthub connect with pool-coordinator etcd failed, and keep try again, the goroutine of grpc is increase all the while, and memory of yurthub also increase, and kubelet will restart it when is happen OOM.
0efec082db7f88f00fa4934ba4ba366

goroutine profile: total 1312
756 @ 0x439896 0x449632 0x1467c65 0x46a9a1
#	0x1467c64	google.golang.org/grpc.(*ccBalancerWrapper).watcher+0xa4	/go/pkg/mod/google.golang.org/[email protected]/balancer_conn_wrappers.go:71

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot openyurt-bot added the kind/bug kind/bug label May 29, 2023
@openyurt-bot openyurt-bot added the size/S size/S 10-29 label May 29, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
2.5% 2.5% Duplication

@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #1501 (381b5f6) into master (6c04014) will decrease coverage by 0.02%.
The diff coverage is 35.71%.

@@            Coverage Diff             @@
##           master    #1501      +/-   ##
==========================================
- Coverage   50.74%   50.73%   -0.02%     
==========================================
  Files         131      131              
  Lines       15576    15586      +10     
==========================================
+ Hits         7904     7907       +3     
- Misses       6951     6958       +7     
  Partials      721      721              
Flag Coverage Δ
unittests 50.73% <35.71%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/yurthub/poolcoordinator/coordinator.go 11.99% <0.00%> (-0.05%) ⬇️
pkg/yurthub/storage/etcd/storage.go 79.71% <0.00%> (-1.18%) ⬇️
pkg/yurthub/storage/etcd/keycache.go 77.87% <100.00%> (+0.28%) ⬆️

@rambohe-ch
Copy link
Member

@Congrool PTAL

Copy link
Member

@Congrool Congrool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks!

Copy link
Member

@Congrool Congrool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks!

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JameKeal, rambohe-ch

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openyurt-bot openyurt-bot added the approved approved label Jun 6, 2023
@openyurt-bot openyurt-bot merged commit c0a1a4c into openyurtio:master Jun 6, 2023
@JameKeal JameKeal deleted the fix-yurthub-memory-leak branch June 6, 2023 11:43
JameKeal added a commit to JameKeal/openyurt that referenced this pull request Jun 9, 2023
@rambohe-ch rambohe-ch added the backport release-v1.3 backport release-v1.3 label Jun 21, 2023
@rambohe-ch
Copy link
Member

/backport release-v1.3

@github-actions
Copy link

Successfully created backport PR for release-v1.3:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved backport release-v1.3 backport release-v1.3 kind/bug kind/bug lgtm lgtm size/S size/S 10-29
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants