From 71e9f6dac2205129523055de37a3dfc09cb2eb6d Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Wed, 24 Jan 2018 15:14:08 -0800 Subject: [PATCH] cmd/containerd-shim, reaper: reduce channel allocation Signed-off-by: Stephen J Day --- cmd/containerd-shim/shim_linux.go | 2 +- reaper/reaper.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/containerd-shim/shim_linux.go b/cmd/containerd-shim/shim_linux.go index 0faa59856..2066c594f 100644 --- a/cmd/containerd-shim/shim_linux.go +++ b/cmd/containerd-shim/shim_linux.go @@ -14,7 +14,7 @@ import ( // setupSignals creates a new signal handler for all signals and sets the shim as a // sub-reaper so that the container processes are reparented 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) // make sure runc is setup to use the monitor // for waiting on processes diff --git a/reaper/reaper.go b/reaper/reaper.go index 9127fc5a1..6e7d4b8dc 100644 --- a/reaper/reaper.go +++ b/reaper/reaper.go @@ -15,7 +15,7 @@ import ( // ErrNoSuchProcess is returned when the process no longer exists 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 // all exited processes and close their wait channels