Skip to content

Commit 71e9f6d

Browse files
committed
cmd/containerd-shim, reaper: reduce channel allocation
Signed-off-by: Stephen J Day <[email protected]>
1 parent 12eaf13 commit 71e9f6d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/containerd-shim/shim_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// setupSignals creates a new signal handler for all signals and sets the shim as a
1515
// sub-reaper so that the container processes are reparented
1616
func setupSignals() (chan os.Signal, error) {
17-
signals := make(chan os.Signal, 2048)
17+
signals := make(chan os.Signal, 32)
1818
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD)
1919
// make sure runc is setup to use the monitor
2020
// for waiting on processes

reaper/reaper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// ErrNoSuchProcess is returned when the process no longer exists
1616
var ErrNoSuchProcess = errors.New("no such process")
1717

18-
const bufferSize = 1024
18+
const bufferSize = 32
1919

2020
// Reap should be called when the process receives an SIGCHLD. Reap will reap
2121
// all exited processes and close their wait channels

0 commit comments

Comments
 (0)