From eef2562c0504a51813f85775d65ac840d083ecce Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Tue, 5 Dec 2017 08:54:36 -0700 Subject: [PATCH 1/2] Clean up external annotator processes Without this, was leaving a zombie process for each external annotator --- lib/annotate.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/annotate.go b/lib/annotate.go index 85d87c6..dbab6b7 100644 --- a/lib/annotate.go +++ b/lib/annotate.go @@ -277,6 +277,7 @@ func (ea *externalAnnotator) Annotate(rd io.Reader) <-chan Annotation { go func() { defer close(out) + defer cmd.Wait() for { start, err := ea.readUint64(stdout) From ac8ceffd70759c5af664ed1b23c65197646a1405 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Tue, 5 Dec 2017 08:55:22 -0700 Subject: [PATCH 2/2] Clean up shell command processes Without this, each command pager's command process would be left as a zombie until the pager was closed. --- lib/shell_command.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/shell_command.go b/lib/shell_command.go index 2e10aa3..e76b662 100644 --- a/lib/shell_command.go +++ b/lib/shell_command.go @@ -40,6 +40,7 @@ func NewShellCommand(c string, ctx Context) (ShellCommand, error) { sc.Reader = io.MultiReader(stdout, stderr) err = sc.cmd.Start() + go func() { sc.cmd.Wait() }() return sc, err }