From 890a98ceed982454515f5b089d9772fc1e4eb6e0 Mon Sep 17 00:00:00 2001 From: Anusha Ragunathan Date: Mon, 28 Nov 2016 12:44:40 -0800 Subject: [PATCH] Fix issue with plugin exit. A plugin has an `ExitChan` channel which is used to signal the exit of the plugin process. In a recent change, the initialization was incorrectly moved to the daemon Shutdown path. Fix this by initializing the channel during plugin enable. Signed-off-by: Anusha Ragunathan --- plugin/manager_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/manager_linux.go b/plugin/manager_linux.go index 6756dba995..bf477f4163 100644 --- a/plugin/manager_linux.go +++ b/plugin/manager_linux.go @@ -26,6 +26,7 @@ func (pm *Manager) enable(p *v2.Plugin, force bool) error { } p.Lock() p.Restart = true + p.ExitChan = make(chan bool) p.Unlock() if err := pm.containerdClient.Create(p.GetID(), "", "", specs.Spec(*spec), attachToLog(p.GetID())); err != nil { return err @@ -92,7 +93,6 @@ func (pm *Manager) Shutdown() { } if pm.containerdClient != nil && p.IsEnabled() { p.Lock() - p.ExitChan = make(chan bool) p.Restart = false p.Unlock() shutdownPlugin(p, pm.containerdClient)