client: simplify kill logic

Remove runLaunched tracking as Run is *always* called for killable
TaskRunners. TaskRunners which fail before Run can be called (during
NewTaskRunner or Restore) are not killable as they're never added to the
client's alloc map.
This commit is contained in:
Michael Schurter
2019-04-04 15:18:33 -07:00
parent 010b9575db
commit 3bad050bf1
3 changed files with 0 additions and 31 deletions

View File

@@ -190,11 +190,6 @@ type TaskRunner struct {
// handlers
driverManager drivermanager.Manager
// runLaunched marks whether the Run goroutine has been started. It should
// be accessed via helpers
runLaunched bool
runLaunchedLock sync.Mutex
// maxEvents is the capacity of the TaskEvents on the TaskState.
// Defaults to defaultMaxEvents but overrideable for testing.
maxEvents int
@@ -378,10 +373,6 @@ func (tr *TaskRunner) initLabels() {
// Run the TaskRunner. Starts the user's task or reattaches to a restored task.
// Run closes WaitCh when it exits. Should be started in a goroutine.
func (tr *TaskRunner) Run() {
// Mark that the run routine has been launched so that other functions can
// decide to use the wait channel or not.
tr.setRunLaunched()
defer close(tr.waitCh)
var result *drivers.ExitResult