Skip to content
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

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

cpuguy83
Copy link
Member

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.

Fixes #32609

@cpuguy83 cpuguy83 force-pushed the 32609_defreference_voldriver_on_error branch 4 times, most recently from e043e01 to f22eb1a Compare October 20, 2017 23:06
@cpuguy83
Copy link
Member Author

For some reason tests work fine running manually but when run from the makefile it's not.

@cpuguy83 cpuguy83 force-pushed the 32609_defreference_voldriver_on_error branch 2 times, most recently from b1c6b50 to b26e068 Compare October 21, 2017 18:38
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]>
@cpuguy83
Copy link
Member Author

Good to go now.

@@ -1,6 +1,8 @@
package plugingetter

import "github.com/docker/docker/pkg/plugins"
import (
"github.com/docker/docker/pkg/plugins"
Copy link
Member

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?

Copy link
Member Author

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) {
Copy link
Member

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! 👍 💯

@vieux vieux self-assigned this Nov 2, 2017
@thaJeztah
Copy link
Member

ping @vieux @tiborvass PTAL ❤️

Copy link
Contributor

@vieux vieux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants