-
Notifications
You must be signed in to change notification settings - Fork 159
Check if registration socket is still valid #322
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
Conversation
|
|
||
| infoRequest := ®isterapi.InfoRequest{} | ||
|
|
||
| info, err := client.GetInfo(ctx, infoRequest) |
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.
GetInfo is correct, this is registration socketProbe() would be more appropriate
| return fmt.Errorf("error connecting to node-registrar socket %s: %v", socketFile, err) | ||
| } | ||
|
|
||
| defer closeGrpcConnection(socketFile, csiConn) |
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.
Does it make sense to close the connection? All CSI sidecars re-use the same connection for all requests. gRPC does some recovery when the socket is closed, AFAIK.
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.
for sidecars I guess it makes sense. I am less sure about periodic checks. I think closing the connection here is fine.
| if info.Name == csiDriverName { | ||
| return nil | ||
| } | ||
| return fmt.Errorf("invalid driver name %s", info.Name) |
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 this be useful? Did we ever saw CSI drivers changing their name?
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 do not think driver name should change without requiring re-registration right?
647cf77 to
fa62285
Compare
fa62285 to
0c52100
Compare
0c52100 to
74e7e31
Compare
| os.Exit(1) | ||
| } | ||
|
|
||
| klog.V(2).Infof("CSI driver name: %q", csiDriverName) |
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.
nit: this log could have been useful
|
|
||
| defer closeGrpcConnection(socketFile, grpcConn) | ||
|
|
||
| klog.V(1).Infof("Calling node registrar to check if it still responds") |
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.
nit: V(2)
74e7e31 to
0d8021d
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
We have a similar problem on our environment, csi-node-driver-registrar process still exists, but the socket has been deactivated, what is the root cause of the problem? Is it an OS issue? |
|
I changed the release note to |
Health check should check if registration socket is really responsive.