-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Fixup some issues with plugin refcounting #35265
Fixup some issues with plugin refcounting #35265
Conversation
e043e01
to
f22eb1a
Compare
For some reason tests work fine running manually but when run from the makefile it's not. |
b1c6b50
to
b26e068
Compare
In some circumstances we were not properly releasing plugin references, leading to failures in removing a plugin with no way to recover other than restarting the daemon. 1. If volume create fails (in the driver) 2. If a driver validation fails (should be rare) 3. If trying to get a plugin that does not match the passed in capability Ideally the test for 1 and 2 would just be a unit test, however the plugin interfaces are too complicated as `plugingetter` relies on github.com/pkg/plugin/Client (a concrete type), which will require spinning up services from within the unit test... it just wouldn't be a unit test at this point. I attempted to refactor this a bit, but since both libnetwork and swarmkit are reliant on `plugingetter` as well, this would not work. This really requires a re-write of the lower-level plugin management to decouple these pieces. Signed-off-by: Brian Goff <[email protected]>
b26e068
to
3816b51
Compare
Good to go now. |
@@ -1,6 +1,8 @@ | |||
package plugingetter | |||
|
|||
import "github.com/docker/docker/pkg/plugins" | |||
import ( | |||
"github.com/docker/docker/pkg/plugins" |
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.
Any reason for this change?
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.
Just that goimports changed it.
return installPath | ||
} | ||
|
||
func asVolumeDriver(cfg *plugin.Config) { |
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.
Love this idea, learned something new! 👍 💯
ping @vieux @tiborvass PTAL ❤️ |
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
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 🐮
In some circumstances we were not properly releasing plugin references,
leading to failures in removing a plugin with no way to recover other
than restarting the daemon.
Ideally the test for 1 and 2 would just be a unit test, however the
plugin interfaces are too complicated as
plugingetter
relies ongithub.com/pkg/plugin/Client (a concrete type), which will require
spinning up services from within the unit test... it just wouldn't be a
unit test at this point.
I attempted to refactor this a bit, but since both libnetwork and
swarmkit are reliant on
plugingetter
as well, this would not work.This really requires a re-write of the lower-level plugin management to
decouple these pieces.
Fixes #32609