-
Notifications
You must be signed in to change notification settings - Fork 113
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
Clean Systemd files on exit #792
Conversation
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
signal.Notify(sigc, syscall.SIGTERM) | ||
|
||
errChan := make(chan error) | ||
defer close(errChan) |
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 used the method used here to close channels. But I believe there is a race in general, on exit (once main goes away, or if os.Exit is called) the goroutines are killed off immediately. So the goroutines listening on this channel will never get the chance to run their intended actions.
cc @e0ne |
Pull Request Test Coverage Report for Build 11341895365Details
💛 - Coveralls |
9700ce2
to
1f68fa8
Compare
If implemented all systemD related files will be cleaned up on exit.
1f68fa8
to
f13f0ab
Compare
@@ -207,6 +207,14 @@ func (dn *Daemon) Run(stopCh <-chan struct{}, exitCh <-chan error) error { | |||
for { | |||
select { | |||
case <-stopCh: | |||
// clean files from host if we are running in systemd mode | |||
if vars.UsingSystemdMode { | |||
err := systemd.CleanSriovFilesFromHost(vars.ClusterType == consts.ClusterTypeOpenshift) |
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.
IIUC when the daemon is stopped we delete systemd files.
if the node reboots (given pods get stop signal) wont it delete the files ? which in turn mean the node will not have SR-IOV configured on startup ?
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.
What you say is correct. We should have a way to identify whether a reboot
has been requested. In that case the cleanUp has to be a best effort because we can have an ongoing reboot and also a spec
change in the daemonSet
.
Signed-off-by: Soule BA <[email protected]>
We have run into an issue where removing the operator leaves behind the systemd files.
If implemented all systemD related files will be cleaned up on exit on non
openshift
distributions.