-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
WIP Fixing leaking gRPC sessions between CSI driver and CSI components #64380
Conversation
@sbezverk: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sbezverk Assign the PR to them by writing 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 |
@saad-ali @vladimirvivien I had to remove unit tests at least for now, because with the way they were built, I could not find how to expose grpc connection without breaking them, and also these unit tests look more like e2e tests. Since we have already a stable e2e test, I hope you would agree if I refactor (possibly in a separate PR) unit tests to test functions and not e2e flow. |
@sbezverk: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/test pull-kubernetes-e2e-gce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The replacement code looks good. I added some suggestions. However, concerned that lot of test code seemed to be deleted.
c.idClient = csipb.NewIdentityClient(conn) | ||
c.nodeClient = csipb.NewNodeClient(conn) | ||
c.ctrlClient = csipb.NewControllerClient(conn) | ||
func (c *csiDriverClient) IdentityRequest() (*grpc.ClientConn, csipb.IdentityClient, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbezverk I would call method IdentidyClient
, instead of IdentityRequest, since it's used to create the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about NewIdentityClient()
?
return conn, c.idClient, nil | ||
} | ||
|
||
func (c *csiDriverClient) NodeRequest() (*grpc.ClientConn, csipb.NodeClient, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call method NodeClient, instead of NodeRequest, since it's used to create the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about NewNodeClient()
?
|
||
// set supported version | ||
func (c *csiDriverClient) ControllerRequest() (*grpc.ClientConn, csipb.ControllerClient, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would call method ControllerClient
, instead of ControllerRequest, since it's used to create the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about NewControllerClient()
?
@@ -1,173 +0,0 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be a good idea to have some tests for the newly added client code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add some tests.
testPodUID = types.UID("test-pod") | ||
) | ||
|
||
func TestMounterGetPath(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the mounter tests deleted ?
) | ||
|
||
// create a plugin mgr to load plugins and setup a fake client | ||
func newTestPlugin(t *testing.T) (*csiPlugin, string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are plugin tests deleted ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all CSI tests are using setupClient func from csi_client_tests which is using fake package to mock the driver. So far I could not figure out a way to make it working with new Identity/Node/Controller clients.
I always get:
panic: interface conversion: csi.NodeClient is *csi.nodeClient, not *fake.NodeClient [recovered]
panic: interface conversion: csi.NodeClient is *csi.nodeClient, not *fake.NodeClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the clients are now being passed around by reference, so the test code should be updated to match that.
The issue is being worked on in a different pr, closing this one. |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. CSI fix for gRPC conn leak **What this PR does / why we need it**: This PR is a bug fix for leaky gRPC connection that never closes (see issue #64341 for detail) **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #64341 This fix was originally started with PR #64380 ```release-note NONE ```
Closes: #64341