Skip to content

Commit

Permalink
Revert "[supervisor] switch lib back to use upstream ramr/go-reaper (
Browse files Browse the repository at this point in the history
…#20322)"

This reverts commit 9442b52.
  • Loading branch information
kylos101 committed Oct 28, 2024
1 parent 6bc053e commit 32383eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
18 changes: 7 additions & 11 deletions components/supervisor/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/gitpod-io/gitpod/common-go/process"
"github.com/gitpod-io/gitpod/supervisor/pkg/shared"
"github.com/gitpod-io/gitpod/supervisor/pkg/supervisor"
reaper "github.com/gitpod-io/go-reaper"
"github.com/prometheus/procfs"
reaper "github.com/ramr/go-reaper"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -114,22 +114,18 @@ var initCmd = &cobra.Command{
}
}()
// start the reaper to clean up zombie processes
reaperChan := make(chan reaper.Status, 10)
reaper.Start(reaper.Config{
Pid: -1,
Options: 0,
DisablePid1Check: false,
StatusChannel: reaperChan,
})
go func() {
for status := range reaperChan {
if status.Pid != runCommand.Process.Pid {
continue
OnReap: func(pid int, wstatus syscall.WaitStatus) {
if pid != runCommand.Process.Pid {
return
}
exitCode := status.WaitStatus.ExitStatus()
exitCode := wstatus.ExitStatus()
handledByReaper <- exitCode
}
}()
},
})

select {
case <-supervisorDone:
Expand Down
1 change: 0 additions & 1 deletion components/supervisor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ require (
github.com/prometheus/common v0.42.0
github.com/prometheus/procfs v0.10.1
github.com/prometheus/pushgateway v1.5.1
github.com/ramr/go-reaper v0.2.2
github.com/sirupsen/logrus v1.9.3
github.com/soheilhy/cmux v0.1.5
github.com/spf13/cobra v1.4.0
Expand Down
4 changes: 2 additions & 2 deletions components/supervisor/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 32383eb

Please sign in to comment.