-
Notifications
You must be signed in to change notification settings - Fork 16
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(usbdevice): close closed channel exception #86
fix(usbdevice): close closed channel exception #86
Conversation
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.
LGTM, thanks, do we need a separate issue for tracking the root cause?
@ibrokethecloud @WebberHuang1118 I find the root cause, it's quite straightforward. We're trying to open gRPC server, and close it after error happens. Each time we start the gRPC server, kubelete invokes But, the program is stuck here since it didn't receive any value from that two channels. done := false
for !done {
select {
case <-plugin.update:
if err := sendUpdate(plugin.devicesToKubeVirtDevicePlugin()); err != nil {
return err
}
case <-plugin.stop:
done = true
} So, I'll add new channel which presents that the gRPC server is closed or not. Please check my latest commits to see the changes, thanks! |
1575e18
to
0063bac
Compare
Signed-off-by: Jack Yu <jack.yu@suse.com>
0063bac
to
c670775
Compare
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.
LGTM, thanks.
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.
lgtm. thanks.
Problem:
Reproduce Steps
usbdeviceclaim
.usbdeviceclaim
.In this cause, the original
usbdeviceclaim
won't work due to device number changed. That's expected.However, theCheck #86 (comment)plugin.deregistered
channel is closed twice due to multiple calls to ListAndWatch. But, I cannot find the root cause yet.bug.mp4
Solution:
Do not use
close
, just make it buffered channel.Related Issue:
harvester/harvester#5762
Test plan:
Follow above steps, it shouldn't complain the same error.
resolved.mp4