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 (
22
22
"github.com/gitpod-io/gitpod/common-go/process"
23
23
"github.com/gitpod-io/gitpod/supervisor/pkg/shared"
24
24
"github.com/gitpod-io/gitpod/supervisor/pkg/supervisor"
25
- reaper "github.com/gitpod-io/go-reaper"
26
25
"github.com/prometheus/procfs"
26
+ reaper "github.com/ramr/go-reaper"
27
27
"github.com/spf13/cobra"
28
28
)
29
29
@@ -114,18 +114,22 @@ var initCmd = &cobra.Command{
114
114
}
115
115
}()
116
116
// start the reaper to clean up zombie processes
117
+ reaperChan := make (chan reaper.Status , 10 )
117
118
reaper .Start (reaper.Config {
118
119
Pid : - 1 ,
119
120
Options : 0 ,
120
121
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
124
128
}
125
- exitCode := wstatus .ExitStatus ()
129
+ exitCode := status . WaitStatus .ExitStatus ()
126
130
handledByReaper <- exitCode
127
- },
128
- })
131
+ }
132
+ }( )
129
133
130
134
select {
131
135
case <- supervisorDone :
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ require (
30
30
github.com/prometheus/common v0.42.0
31
31
github.com/prometheus/procfs v0.10.1
32
32
github.com/prometheus/pushgateway v1.5.1
33
+ github.com/ramr/go-reaper v0.2.2
33
34
github.com/sirupsen/logrus v1.9.3
34
35
github.com/soheilhy/cmux v0.1.5
35
36
github.com/spf13/cobra v1.4.0
You can’t perform that action at this time.
0 commit comments