Skip to content

Commit

Permalink
fix: Fix zombie jinja2 processes
Browse files Browse the repository at this point in the history
We missed calling Wait() on the process.
  • Loading branch information
codablock committed May 30, 2022
1 parent f686192 commit eda52d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/jinja2/jinja2_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os/exec"
"path/filepath"
"strings"
"time"
)

type pythonJinja2Renderer struct {
Expand Down Expand Up @@ -75,7 +76,11 @@ func (j *pythonJinja2Renderer) Close() {
}
if j.cmd != nil {
if j.cmd.Process != nil {
_ = j.cmd.Process.Kill()
timer := time.AfterFunc(5*time.Second, func() {
_ = j.cmd.Process.Kill()
})
_ = j.cmd.Wait()
timer.Stop()
}
j.cmd = nil
}
Expand Down

0 comments on commit eda52d1

Please sign in to comment.