Commit cfa9cef2 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/plugin: Set killed in the kill clients method

parent f68e0008
...@@ -73,6 +73,9 @@ type ClientConfig struct { ...@@ -73,6 +73,9 @@ type ClientConfig struct {
// //
// This must only be called _once_. // This must only be called _once_.
func CleanupClients() { func CleanupClients() {
// Set the killed to true so that we don't get unexpected panics
Killed = true
// Kill all the managed clients in parallel and use a WaitGroup // Kill all the managed clients in parallel and use a WaitGroup
// to wait for them all to finish up. // to wait for them all to finish up.
var wg sync.WaitGroup var wg sync.WaitGroup
......
...@@ -28,7 +28,6 @@ func setupSignalHandlers(env packer.Environment) { ...@@ -28,7 +28,6 @@ func setupSignalHandlers(env packer.Environment) {
// Force kill all the plugins, but mark that we're killing them // Force kill all the plugins, but mark that we're killing them
// first so that we don't get panics everywhere. // first so that we don't get panics everywhere.
plugin.Killed = true
plugin.CleanupClients() plugin.CleanupClients()
os.Exit(1) os.Exit(1)
}() }()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment