From 93ba370c3ab12e0219120fddf866e1fe836c102d Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Mon, 7 Jul 2025 16:57:19 +0200 Subject: [PATCH] Close stdout pipe if process stays too long in finished state --- process/process.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/process/process.go b/process/process.go index ce0e077c..114994df 100644 --- a/process/process.go +++ b/process/process.go @@ -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 }