-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Shutdown plugins during daemon shutdown. #24229
Conversation
But we shouldn't do this if live-restore is enabled, right? |
daemon/daemon.go:687: undefined: plugin.GetManager |
@cpuguy83 : The live-restore case bails out much early in the function. |
f9c6532
to
c11ee0b
Compare
@@ -128,3 +128,21 @@ func (pm *Manager) disable(p *plugin) error { | |||
pm.save() | |||
return nil | |||
} | |||
|
|||
// Shutdown stops all plugins and called during daemon shutdown. | |||
func (pm *Manager) Shutdown() error { |
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.
We never return an error, correct? Should we fail if a plugin fails to stop?
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.
We return the error now. But its purely for logging purposes. The daemon shutdown should not fail, if any of the sub components fail to stop. It should continue its best-effort shutdown, as it does today.
@anusha-ragunathan is this for 1.12? |
6ff4422
to
552e64a
Compare
@thaJeztah : Yes, we should take this for 1.12 |
@anusha-ragunathan Is it possible to write test? |
552e64a
to
d11ccd9
Compare
@LK4D4 : Done! |
@anusha-ragunathan great, thanks! |
I think experimental failure is unrelated. |
|
4eeaeb4
to
8e1a065
Compare
@cpuguy83 : Fixed the experimental windows cross compile issue. PTAL. |
} | ||
} | ||
if pm.containerdClient != nil { | ||
if err := pm.containerdClient.Signal(p.P.ID, int(syscall.SIGKILL)); err != nil { |
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.
We should give the plugin a chance to shutdown gracefully with SIGTERM
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.
Or rather STOPSIGNAL
if that was brought over from the image format.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
8e1a065
to
863ab9a
Compare
@cpuguy83 : Graceful shutdown added. PTAL. |
LGTM |
Signed-off-by: Anusha Ragunathan anusha@docker.com