Closing the rotators when the process finishes
This commit is contained in:
parent
9eb646f5a2
commit
7fcbdf5a9b
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue