1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg
Brian Goff b9d6c87592 Fix panic in loading plugins
When a plugin is first found, it is loaded into the available plugins
even though it's not activated yet.
If activation fails it is taken out of the list.
While it is in the list, other callers may see it and try to check it's
manifest. If it is not fully activated yet, the manifest will be nil and
cause a panic.

This is especially problematic for drivers that are down and have not
been activated yet.

We could just not load the plugin into the available list until it's
fully active, however that will just cause multiple of the same plugin
to attemp to be loaded.

We could check if the manifest is nil and return early (instead of
panicing on a nil manifest), but this will cause a 2nd caller to receive
a response while the first caller is still waiting, which can be
awkward.

This change uses a condition variable to handle activation (instead of
sync.Once). If the plugin is not activated, callers will all wait until
it is activated and receive a broadcast from the condition variable
signaling that it's ok to proceed, in which case we'll check if their
was an error in activation and proceed accordingly.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit baac2f4867)
2016-03-25 13:43:05 -04:00
..
aaparser apparmor: fix version checks to work properly 2016-02-15 20:36:07 +11:00
archive Fix CopyWithTar creation of new destination dir as remapped root 2016-03-12 23:05:45 -05:00
authorization fix variables that werent being called 2016-03-17 13:19:55 -07:00
broadcaster
chrootarchive Remove flush(stdout) in pkg/chrootarchive/diff_unix.go and improve error reporting of flush() to fix #21103 2016-03-15 10:29:51 -07:00
devicemapper
directory fix variables that werent being called 2016-03-17 13:19:55 -07:00
discovery Use net.JoinHostPort to handle address format. 2016-03-01 17:27:30 -08:00
filenotify add file poller panic fix from 1.10.2 2016-02-24 10:17:29 -05:00
fileutils Windows CI: Turn off failing unit test pkg\fileutils 2016-03-02 19:05:33 -08:00
gitutils
graphdb Windows CI: Turn off failing unit tests pkg\graphdb 2016-03-02 19:27:41 -08:00
homedir Revert "resolve the config file from the sudo user" 2016-02-29 13:51:43 +01:00
httputils Fix some typos in comments and strings 2016-02-22 20:27:15 +01:00
idtools Change subordinate range-owning user to be a system user 2016-03-16 18:44:10 -04:00
integration Windows CI: Turn off failing unit tests pkg\integration 2016-03-02 19:37:18 -08:00
ioutils
jsonlog fix variables that werent being called 2016-03-17 13:19:55 -07:00
jsonmessage
locker
longpath
loopback
mflag
mount Windows: Fix mountinfo 2016-03-21 22:03:24 -07:00
namesgenerator
parsers
pidfile
platform
plugins Fix panic in loading plugins 2016-03-25 13:43:05 -04:00
pools fix variables that werent being called 2016-03-17 13:19:55 -07:00
progress
promise
proxy
pubsub Revert "use pubsub instead of filenotify to follow json logs" 2016-02-23 21:43:52 -05:00
random
reexec
registrar
signal Don't forward SIGPIPE from client to container 2016-03-18 16:50:18 -04:00
stdcopy Make stdcopy.stdWriter goroutine safe. 2016-02-26 16:51:18 -05:00
streamformatter Fix flaky test TestJSONFormatProgress (#21124) 2016-03-14 16:00:12 +00:00
stringid
stringutils
symlink fix variables that werent being called 2016-03-17 13:19:55 -07:00
sysinfo pids limit support 2016-03-08 07:55:01 -08:00
system Merge pull request #21325 from frenkel/openbsd-support 2016-03-18 20:53:17 -04:00
tailfile
tarsum fix variables that werent being called 2016-03-17 13:19:55 -07:00
term Cli binary can now be build on OpenBSD 2016-03-18 14:56:21 +01:00
tlsconfig
truncindex pkg: truncindex: provide more info in error 2016-03-17 15:53:12 +01:00
urlutil
useragent
version
README.md

pkg/ is a collection of utility packages used by the Docker project without being specific to its internals.

Utility packages are kept separate from the docker core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Docker organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!