Browse Source

Fix deadlock on plugin shutdown.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 4d009084de8cad94a180130eb57efa2a98df6d98)
Signed-off-by: Tibor Vass <tibor@docker.com>
Anusha Ragunathan 9 năm trước cách đây
mục cha
commit
a3f2c03ef0

+ 1 - 1
integration-cli/docker_cli_daemon_experimental_test.go

@@ -46,7 +46,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *check.C) {
 	c.Assert(out, checker.Contains, "true")
 	c.Assert(out, checker.Contains, "true")
 }
 }
 
 
-// TestDaemonRestartWithPluginEnabled tests state restore for a disabled plugin
+// TestDaemonRestartWithPluginDisabled tests state restore for a disabled plugin
 func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
 func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
 	if err := s.d.Start(); err != nil {
 	if err := s.d.Start(); err != nil {
 		c.Fatalf("Could not start daemon: %v", err)
 		c.Fatalf("Could not start daemon: %v", err)

+ 0 - 4
plugin/manager_linux.go

@@ -174,10 +174,6 @@ func (pm *Manager) Shutdown() {
 				}
 				}
 			}
 			}
 			close(p.exitChan)
 			close(p.exitChan)
-			pm.Lock()
-			p.PluginObj.Active = false
-			pm.save()
-			pm.Unlock()
 		}
 		}
 		if err := os.RemoveAll(p.runtimeSourcePath); err != nil {
 		if err := os.RemoveAll(p.runtimeSourcePath); err != nil {
 			logrus.Errorf("Remove plugin runtime failed with error: %v", err)
 			logrus.Errorf("Remove plugin runtime failed with error: %v", err)