-
Notifications
You must be signed in to change notification settings - Fork 35
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
Properly handle graceful shutdown of the kubelet plugin #68
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kevin Klues <[email protected]>
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: byako, klueska The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Some description of what problem this change addresses would be useful. Both commit message and PR description are empty. |
|
||
err = driver.Shutdown(ctx) |
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.
So I looked at the updated description and it is still not clear to me why this change is needed. Why did the old code not work?
As far as I can tell, the change just shuffles code around. Before and after, driver.Shutdown
should have been reached. What am I missing?
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.
And how exactly do you delete the driver such that the ResourceSlice doesn't get deleted? Deleting either the entire Helm release and the DaemonSet by itself seem to clean up the ResourceSlice for me.
signal.Notify(sigc, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) | ||
<-sigc | ||
sigs := make(chan os.Signal, 1) | ||
signal.Notify(sigs, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) |
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.
It looks like this is implementing some of the wrapping provided by signal.NotifyContext
. Would using that simplify things here?
|
||
err = driver.Shutdown(ctx) |
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.
And how exactly do you delete the driver such that the ResourceSlice doesn't get deleted? Deleting either the entire Helm release and the DaemonSet by itself seem to clean up the ResourceSlice for me.
Without this change, deletion of the DRA driver will not remove resource slices. There is an open issue in kubernetes (kubernetes/kubernetes#128696) that would ensure that these resources slices get removed even if there is no graceful shutdown, but it's still good to shutdown gracefully regardless.