Skip to content

Commit 3b282ad

Browse files
committed
be consistent in cleaning up failed controllable task
1 parent 0ed2a5a commit 3b282ad

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

executor/executable/controllabletask.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ func (t *ControllableTask) doLaunchTask(taskCmd *exec.Cmd, launchStartTime time.
194194
Error("could not start gRPC client")
195195

196196
t.sendStatus(t.knownEnvironmentId, mesos.TASK_FAILED, err.Error())
197-
_ = t.doTermIntKill(-taskCmd.Process.Pid)
197+
198+
t.cleanupFailedTask(taskCmd)
198199
return
199200
}
200201
t.rpc.TaskCmd = taskCmd
@@ -234,9 +235,7 @@ func (t *ControllableTask) doLaunchTask(taskCmd *exec.Cmd, launchStartTime time.
234235
WithError(err).
235236
Error("cannot set up event stream from task")
236237
t.sendStatus(t.knownEnvironmentId, mesos.TASK_FAILED, err.Error())
237-
_ = t.rpc.Close()
238-
t.rpc = nil
239-
// fixme: why don't we kill the task in this error case, but we do in others?
238+
t.cleanupFailedTask(taskCmd)
240239
return
241240
}
242241

0 commit comments

Comments
 (0)