mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
cleanup driver eventor goroutines
This fixes few cases where driver eventor goroutines are leaked during normal operations, but especially so in tests. This change makes few modifications: First, it switches drivers to use `Context`s to manage shutdown events. Previously, it relied on callers invoking `.Shutdown()` function that is specific to internal drivers only and require casting. Using `Contexts` provide a consistent idiomatic way to manage lifecycle for both internal and external drivers. Also, I discovered few places where we don't clean up a temporary driver instance in the plugin catalog code, where we dispense a driver to inspect and validate the schema config without properly cleaning it up.
This commit is contained in:
@@ -248,10 +248,6 @@ func (i *instanceManager) cleanup() {
|
||||
return
|
||||
}
|
||||
|
||||
if internalPlugin, ok := i.plugin.Plugin().(drivers.InternalDriverPlugin); ok {
|
||||
internalPlugin.Shutdown()
|
||||
}
|
||||
|
||||
if !i.plugin.Exited() {
|
||||
i.plugin.Kill()
|
||||
if err := i.storeReattach(nil); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user