You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Race 1: In runNativeCommand, after killing a process on timeout, the code
read outBuf.String() without waiting for cmd.Wait() to complete. The
internal pipe-copy goroutines spawned by exec.Cmd could still be writing
to the buffer. Fix by draining the done channel after kill to ensure
cmd.Wait() finishes before reading the buffer. Use a 3-second grace
period after SIGTERM, escalating to SIGKILL if the process doesn't exit,
to prevent indefinite hangs on processes that ignore SIGTERM.
Race 2: In background jobs, limitedWriter used its own sync.Mutex while
ViewBackgroundJob/ListBackgroundJobs/monitorJob used job.outputMu to
protect the same bytes.Buffer. Fix by making limitedWriter share the
job's outputMu (as a *sync.RWMutex), so all access to the buffer goes
through a single lock.
Assisted-By: docker-agent
0 commit comments