-
Notifications
You must be signed in to change notification settings - Fork 141
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]fix windows node register failure issue #149
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: andyzhangx The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@lizhuqi did you hit this registration issue on GKE Windows node? |
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.
/assign @jingxu97
// Registers kubelet plugin watcher api. | ||
registerapi.RegisterRegistrationServer(grpcServer, registrar) | ||
if runtime.GOOS == "windows" { | ||
for true { |
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.
Instead of retrying forever, do we want to return fatalf?
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.
try a few times(e.g. 10 times) is also an option, I am ok with that.
// try register on Windows node in a loop, detailed issue: | ||
// https://github.com/kubernetes-csi/node-driver-registrar/issues/143 | ||
err := wait.PollImmediate(1*time.Second, 30*time.Second, func() (bool, error) { | ||
registerapi.RegisterRegistrationServer(grpcServer, registrar) |
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 issue description says that this call hangs forever. I don't think this Poll method is going to ever return in that case. I think you'll need to run the call in a go routine and wait for the result or timeout that way.
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 think that's a wrong fix, do you know is there any way to restart node-driver-registrar automatically if register is not succeeded within a few seconds? The registration issue happens on both Azure & GKE Windows node now. When we hit the issue, restart node driver always works.
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 think returning a fatal error is the main way to cause node-driver-registrar to restart.
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.
From the log you showed that the hang happened after this registration process. So will loop here help?
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.
This PR won't work, after registerapi.RegisterRegistrationServer
, it just wait for following GetInfo
invoked, while sometimes on Windows node, it never happens.
node-driver-registrar/cmd/csi-node-driver-registrar/main.go
Lines 78 to 80 in 1c2d606
// GetInfo is the RPC invoked by plugin watcher | |
func (e registrationServer) GetInfo(ctx context.Context, req *registerapi.InfoRequest) (*registerapi.PluginInfo, error) { | |
klog.Infof("Received GetInfo call: %+v", req) |
I hit this issue on GCE Cluster Windows node. |
// Registers kubelet plugin watcher api. | ||
registerapi.RegisterRegistrationServer(grpcServer, registrar) |
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.
Are we sure that this is the line where it hangs? I checked the kubelet & gRPC codebase and I see that it's just setting some properties in the server but it's not making any calls:
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.
@andyzhangx comment here #149 (comment)
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.
got it, thanks Jing, so it looks like after registration the kubelet doesn't call node-driver-registrar back (which could be because the request never got to the Kubelet or the kubelet acknowledged the request and didn't reply back), I think that if this is reproducible we should check the kubelet logs
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.
@mauriciopoppe I am not quite familiar with node-driver-registrar, is there any way to fail when node-driver-registrar did not receive ack from kubelet? There could be many issues that kubelet does not respond, if node-driver-registrar could fail, then it would retry, I think that would fix this issue.
This PR does not fix the issue actully.
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'll add some comments to #143
would be fixed by #152 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix windows node register failure issue
This PR uses an endless loop to retry registration on Windows only.
On Windows, we found that this node-driver-registrar hang on below statement forever in a little possibility, and then after restart registrar manually, it could register correctly, need a way to add timeout and retry in below statement:
node-driver-registrar/cmd/csi-node-driver-registrar/node_register.go
Lines 63 to 64 in d79871c
Which issue(s) this PR fixes:
Fixes #143
Special notes for your reviewer:
Does this PR introduce a user-facing change?: