Skip to content

Commit

Permalink
Explictly set state of a disabled plugin.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
anusha-ragunathan committed Mar 24, 2017
1 parent d8406fd commit bbbf64f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugin/manager_linux.go
Expand Up @@ -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
}
Expand Down

0 comments on commit bbbf64f

Please sign in to comment.