File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ import (
2222 "github.com/gitpod-io/gitpod/common-go/process"
2323 "github.com/gitpod-io/gitpod/supervisor/pkg/shared"
2424 "github.com/gitpod-io/gitpod/supervisor/pkg/supervisor"
25- reaper "github.com/gitpod-io/go-reaper"
2625 "github.com/prometheus/procfs"
26+ reaper "github.com/ramr/go-reaper"
2727 "github.com/spf13/cobra"
2828)
2929
@@ -114,18 +114,22 @@ var initCmd = &cobra.Command{
114114 }
115115 }()
116116 // start the reaper to clean up zombie processes
117+ reaperChan := make (chan reaper.Status , 10 )
117118 reaper .Start (reaper.Config {
118119 Pid : - 1 ,
119120 Options : 0 ,
120121 DisablePid1Check : false ,
121- OnReap : func (pid int , wstatus syscall.WaitStatus ) {
122- if pid != runCommand .Process .Pid {
123- return
122+ StatusChannel : reaperChan ,
123+ })
124+ go func () {
125+ for status := range reaperChan {
126+ if status .Pid != runCommand .Process .Pid {
127+ continue
124128 }
125- exitCode := wstatus .ExitStatus ()
129+ exitCode := status . WaitStatus .ExitStatus ()
126130 handledByReaper <- exitCode
127- },
128- })
131+ }
132+ }( )
129133
130134 select {
131135 case <- supervisorDone :
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ require (
3030 github.com/prometheus/common v0.42.0
3131 github.com/prometheus/procfs v0.10.1
3232 github.com/prometheus/pushgateway v1.5.1
33+ github.com/ramr/go-reaper v0.2.2
3334 github.com/sirupsen/logrus v1.9.3
3435 github.com/soheilhy/cmux v0.1.5
3536 github.com/spf13/cobra v1.4.0
You can’t perform that action at this time.
0 commit comments