-
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
Pci device plugin fix orphan goroutine and remove unused channel #67
base: master
Are you sure you want to change the base?
Pci device plugin fix orphan goroutine and remove unused channel #67
Conversation
Signed-off-by: Webber Huang <[email protected]>
I traced the original The heartBeat will trigger kubevirt to refresh the permitted devices. In device_plugin part, it uses The structure is one |
@Yu-Jack, Thanks for your explanation, IIUC, in the current implementation IMHO, since this PR doesn't introduce any structural or control flow change, I'd like to remove the unused code path. WDYT? cc @bk201 @ibrokethecloud , thanks. |
Just leave link to original comment #66 (comment) if we don't want to remove existing codes. |
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 prefer not to delete stop channel. This stop is a control flag to control device plugin. For example, if we remove this stop, it can't return in health check function. Instead, we can remove done channel in this case.
Looks like one channel is enough. we could either use done or stop to trigger cleanup. that channel should be used in the healthcheck. this is legacy stuff which we copied over when we tried to setup the device plugins. Thanks for the PR @WebberHuang1118 to help clean this up. |
Problem:
After a PCI device plugin is disabled, there is Go routine (invoked as the device plugin started) blocked by chan stop, however, chan stop is never touched, this brings an orphan Go routine once a PCI device is enabled and disabled.
Solution:
PCI device plugin fix the orphan goroutine and removes unused channel
Related Issue:
harvester/harvester#5179
Additional Context:
The CodeFactor
Complex Method
error could be fixed once PR #66 merged