mirror of
https://github.com/moby/moby.git
synced 2026-08-04 23:21:00 +00:00
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 <anusha@docker.com>
(cherry picked from commit 890a98ceed)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
committed by
Victor Vieux
parent
e3d03adc25
commit
8c56588d04
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user