diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index 104edd757..47c33bf4b 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -194,6 +194,8 @@ func (e *UniversalExecutor) UpdateLogConfig(logConfig *structs.LogConfig) error func (e *UniversalExecutor) wait() { defer close(e.processExited) err := e.cmd.Wait() + e.lre.Close() + e.lro.Close() if err == nil { e.exitState = &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()} return diff --git a/client/driver/executor/executor_test.go b/client/driver/executor/executor_test.go index 609e7e64a..68195953d 100644 --- a/client/driver/executor/executor_test.go +++ b/client/driver/executor/executor_test.go @@ -85,7 +85,7 @@ func TestExecutor_Start_Wait_Failure_Code(t *testing.T) { func TestExecutor_Start_Wait(t *testing.T) { execCmd := ExecCommand{Cmd: "/bin/echo", Args: []string{"hello world"}} ctx := testExecutorContext(t) - //defer ctx.AllocDir.Destroy() + defer ctx.AllocDir.Destroy() executor := NewExecutor(log.New(os.Stdout, "", log.LstdFlags)) ps, err := executor.LaunchCmd(&execCmd, ctx) if err != nil {