b9d6c87592
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
|
||
---|---|---|
.. | ||
aaparser | ||
archive | ||
authorization | ||
broadcaster | ||
chrootarchive | ||
devicemapper | ||
directory | ||
discovery | ||
filenotify | ||
fileutils | ||
gitutils | ||
graphdb | ||
homedir | ||
httputils | ||
idtools | ||
integration | ||
ioutils | ||
jsonlog | ||
jsonmessage | ||
locker | ||
longpath | ||
loopback | ||
mflag | ||
mount | ||
namesgenerator | ||
parsers | ||
pidfile | ||
platform | ||
plugins | ||
pools | ||
progress | ||
promise | ||
proxy | ||
pubsub | ||
random | ||
reexec | ||
registrar | ||
signal | ||
stdcopy | ||
streamformatter | ||
stringid | ||
stringutils | ||
symlink | ||
sysinfo | ||
system | ||
tailfile | ||
tarsum | ||
term | ||
tlsconfig | ||
truncindex | ||
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!