Close stdout pipe if process stays too long in finished state
This commit is contained in:
parent
290c612d01
commit
93ba370c3a
@ -813,6 +813,11 @@ func (p *process) stop(wait bool, reason string) error {
|
||||
|
||||
// If the process is already in the finishing state, don't do anything
|
||||
if state, _ := p.setState(stateFinishing); state == stateFinishing {
|
||||
p.state.lock.RLock()
|
||||
if time.Since(p.state.time) > 10*time.Second {
|
||||
p.stdout.Close()
|
||||
}
|
||||
p.state.lock.RUnlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user