baac2f4867
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> |
||
---|---|---|
.. | ||
pluginrpc-gen | ||
transport | ||
client.go | ||
client_test.go | ||
discovery.go | ||
discovery_test.go | ||
discovery_unix_test.go | ||
errors.go | ||
plugins.go |