moby/pkg/plugins
Brian Goff 21fcbb39b7 Fix race accessing plugin storage map
`plugins.GetAll()` was not locking the plugin map when checking if a
plugin exists, this can cause a race and potentially a panic if another
goroutine is trying to load a plugin into the map at the same time.

Also fixes a race during activation where a plugin inserts itself into
the plugin map but does not check if something else is already there.
This is already checked before trying to activate the plugin, however
the map lock is not held for this entire period, so other plugins may be
loaded during this time.
To fix, before inserting the plugin into the map, check if one with the
same name already exists and use that instead.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-01-05 22:40:45 -05:00
..
pluginrpc-gen duplicated the 2016-12-21 20:16:19 +08:00
transport Call plugins with custom transports. 2016-03-02 12:54:53 -05:00
client.go Add HTTP client timeout. 2016-11-21 13:11:40 -08:00
client_test.go Revert "Add default timeout to pkg/plugins/client" 2016-09-20 10:01:03 +02:00
discovery.go Add spec file support for Windows plugin discovery. 2016-08-22 09:14:57 -07:00
discovery_test.go Fix govet for go1.7 2016-09-02 19:07:54 -07:00
discovery_unix.go fix spec file support for Windows plugin discovery (#25903) 2016-08-26 22:11:58 +02:00
discovery_unix_test.go Fix govet for go1.7 2016-09-02 19:07:54 -07:00
discovery_windows.go fix spec file support for Windows plugin discovery (#25903) 2016-08-26 22:11:58 +02:00
errors.go Fix some typos in comments and strings 2016-02-22 20:27:15 +01:00
plugin_test.go Fix race/deadlock in v1 plugin handlers 2016-12-27 12:27:41 -05:00
plugins.go Fix race accessing plugin storage map 2017-01-05 22:40:45 -05:00