Skip to content

Commit

Permalink
Merge pull request #11240 from vrothberg/art
Browse files Browse the repository at this point in the history
make sure that signal buffers are sufficiently big
  • Loading branch information
openshift-ci[bot] authored Aug 17, 2021
2 parents 8c228bd + fe2be7f commit de4d7b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libpod/shutdown/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Start() error {
return nil
}

sigChan = make(chan os.Signal, 1)
sigChan = make(chan os.Signal, 2)
cancelChan = make(chan bool, 1)
stopped = false

Expand Down
6 changes: 5 additions & 1 deletion pkg/domain/infra/abi/terminal/sigproxy_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ import (
"github.com/sirupsen/logrus"
)

// Make sure the signal buffer is sufficiently big.
// runc is using the same value.
const signalBufferSize = 2048

// ProxySignals ...
func ProxySignals(ctr *libpod.Container) {
// Stop catching the shutdown signals (SIGINT, SIGTERM) - they're going
// to the container now.
shutdown.Stop()

sigBuffer := make(chan os.Signal, 128)
sigBuffer := make(chan os.Signal, signalBufferSize)
signal.CatchAll(sigBuffer)

logrus.Debugf("Enabling signal proxying")
Expand Down
3 changes: 1 addition & 2 deletions pkg/rootless/rootless_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,6 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
return false, -1, errors.Wrapf(err, "error setting up the process")
}

c := make(chan os.Signal, 1)

signals := []os.Signal{}
for sig := 0; sig < numSig; sig++ {
if sig == int(unix.SIGTSTP) {
Expand All @@ -407,6 +405,7 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
signals = append(signals, unix.Signal(sig))
}

c := make(chan os.Signal, len(signals))
gosignal.Notify(c, signals...)
defer gosignal.Reset()
go func() {
Expand Down

0 comments on commit de4d7b2

Please sign in to comment.