mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
docker: Delete Task on Destroy
Currently the docker driver does not remove tasks from its state map when destroying the task, which leads to issues when restarting tasks in place, and leaks expired handles over time.
This commit is contained in:
@@ -1019,6 +1019,7 @@ func (d *Driver) DestroyTask(taskID string, force bool) error {
|
||||
}
|
||||
|
||||
defer h.dloggerPluginClient.Kill()
|
||||
|
||||
if err := h.client.StopContainer(h.containerID, 0); err != nil {
|
||||
h.logger.Warn("failed to stop container during destroy", "error", err)
|
||||
}
|
||||
@@ -1033,6 +1034,7 @@ func (d *Driver) DestroyTask(taskID string, force bool) error {
|
||||
"error", err)
|
||||
}
|
||||
|
||||
d.tasks.Delete(taskID)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user