Commit 3a955722 authored by Yifan Gu's avatar Yifan Gu

Changed the keepChannel to buffered channel.

Since the keepChannel is used to send data, not just for synchronizaiton, so make it a buffered channel can avoid unnecessary goroutine yields.
parent e48d85a4
......@@ -44,6 +44,8 @@ import (
"gopkg.in/v1/yaml"
)
const defaultChanSize = 1024
// DockerContainerData is the structured representation of the JSON object returned by Docker inspect
type DockerContainerData struct {
state struct {
......@@ -758,7 +760,7 @@ func (kl *Kubelet) SyncManifests(config []api.ContainerManifest) error {
glog.Infof("Desired: %+v", config)
var err error
dockerIdsToKeep := map[DockerID]empty{}
keepChannel := make(chan DockerID)
keepChannel := make(chan DockerID, defaultChanSize)
waitGroup := sync.WaitGroup{}
// Check for any containers that need starting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment