cmd/containerd-shim, reaper: reduce channel allocation

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2018-01-24 15:14:08 -08:00
parent 12eaf13f6f
commit 71e9f6dac2
No known key found for this signature in database
GPG Key ID: 67B3DED84EDC823F
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import (
// setupSignals creates a new signal handler for all signals and sets the shim as a // setupSignals creates a new signal handler for all signals and sets the shim as a
// sub-reaper so that the container processes are reparented // sub-reaper so that the container processes are reparented
func setupSignals() (chan os.Signal, error) { func setupSignals() (chan os.Signal, error) {
signals := make(chan os.Signal, 2048) signals := make(chan os.Signal, 32)
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD) signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD)
// make sure runc is setup to use the monitor // make sure runc is setup to use the monitor
// for waiting on processes // for waiting on processes

View File

@ -15,7 +15,7 @@ import (
// ErrNoSuchProcess is returned when the process no longer exists // ErrNoSuchProcess is returned when the process no longer exists
var ErrNoSuchProcess = errors.New("no such process") var ErrNoSuchProcess = errors.New("no such process")
const bufferSize = 1024 const bufferSize = 32
// Reap should be called when the process receives an SIGCHLD. Reap will reap // Reap should be called when the process receives an SIGCHLD. Reap will reap
// all exited processes and close their wait channels // all exited processes and close their wait channels