drivers: Implement InternalPluginDriver interface

This implements the InternalPluginDriver interface in each driver, and
calls the cancellation fn for their respective eventers.

This fixes a per task goroutine leak during test suite execution.
This commit is contained in:
Danielle Tomlinson
2018-12-20 13:25:07 +01:00
parent 994057abf4
commit 476e44b4e4
8 changed files with 23 additions and 6 deletions

View File

@@ -1242,3 +1242,7 @@ func sliceMergeUlimit(ulimitsRaw map[string]string) ([]docker.ULimit, error) {
}
return ulimits, nil
}
func (d *Driver) Shutdown() {
d.signalShutdown()
}

View File

@@ -143,9 +143,8 @@ func (d *Driver) SetConfig(cfg *base.Config) error {
return nil
}
func (d *Driver) Shutdown(ctx context.Context) error {
func (d *Driver) Shutdown() {
d.signalShutdown()
return nil
}
func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error) {

View File

@@ -556,3 +556,7 @@ func GetAbsolutePath(bin string) (string, error) {
return filepath.EvalSymlinks(lp)
}
func (d *Driver) Shutdown() {
d.signalShutdown()
}

View File

@@ -216,9 +216,8 @@ func (d *Driver) SetConfig(cfg *base.Config) error {
return nil
}
func (d *Driver) Shutdown(ctx context.Context) error {
func (d *Driver) Shutdown() {
d.signalShutdown()
return nil
}
func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error) {

View File

@@ -550,3 +550,7 @@ func (d *Driver) GetHandle(taskID string) *taskHandle {
h, _ := d.tasks.Get(taskID)
return h
}
func (d *Driver) Shutdown() {
d.signalShutdown()
}

View File

@@ -644,3 +644,7 @@ func sendQemuShutdown(logger hclog.Logger, monitorPath string, userPid int) erro
}
return err
}
func (d *Driver) Shutdown() {
d.signalShutdown()
}

View File

@@ -189,9 +189,8 @@ func (d *Driver) SetConfig(cfg *base.Config) error {
return nil
}
func (d *Driver) Shutdown(ctx context.Context) error {
func (d *Driver) Shutdown() {
d.signalShutdown()
return nil
}
func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error) {

View File

@@ -1054,3 +1054,7 @@ func (d *Driver) handleWait(ctx context.Context, handle *taskHandle, ch chan *dr
case ch <- result:
}
}
func (d *Driver) Shutdown() {
d.signalShutdown()
}