From bbbf64f7128c3784f500cd15a994f20ab5d80920 Mon Sep 17 00:00:00 2001 From: Anusha Ragunathan Date: Fri, 24 Mar 2017 12:05:12 -0700 Subject: [PATCH] Explictly set state of a disabled plugin. While restoring plugins during daemon restart, some plugins can fail to respond to net.Dial. These plugins should be explicitly set to disabled, else they will retain their original state of enabled, which is incorrect. Tested with a plugin that fails to restart and observed that the state was set to disabled. Signed-off-by: Anusha Ragunathan --- plugin/manager_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/manager_linux.go b/plugin/manager_linux.go index 847868f9d3..3c9bad4d65 100644 --- a/plugin/manager_linux.go +++ b/plugin/manager_linux.go @@ -97,6 +97,8 @@ func (pm *Manager) pluginPostStart(p *v2.Plugin, c *controller) error { if retries > maxRetries { logrus.Debugf("error net dialing plugin: %v", err) c.restart = false + // While restoring plugins, we need to explicitly set the state to disabled + pm.config.Store.SetState(p, false) shutdownPlugin(p, c, pm.containerdClient) return err }