Browse Source

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 <anusha.ragunathan@docker.com>
Anusha Ragunathan 8 years ago
parent
commit
bbbf64f712
1 changed files with 2 additions and 0 deletions
  1. 2 0
      plugin/manager_linux.go

+ 2 - 0
plugin/manager_linux.go

@@ -97,6 +97,8 @@ func (pm *Manager) pluginPostStart(p *v2.Plugin, c *controller) error {
 		if retries > maxRetries {
 		if retries > maxRetries {
 			logrus.Debugf("error net dialing plugin: %v", err)
 			logrus.Debugf("error net dialing plugin: %v", err)
 			c.restart = false
 			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)
 			shutdownPlugin(p, c, pm.containerdClient)
 			return err
 			return err
 		}
 		}