From 91d9b4fc29831816114054a59ac326ae49678552 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Tue, 26 Sep 2017 16:24:55 +0200 Subject: [PATCH] cmd: crio: correctly stop the streaming server Signed-off-by: Antonio Murdaca --- cmd/crio/main.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cmd/crio/main.go b/cmd/crio/main.go index e58adb11..1f211d63 100644 --- a/cmd/crio/main.go +++ b/cmd/crio/main.go @@ -162,8 +162,7 @@ func catchShutdown(gserver *grpc.Server, sserver *server.Server, hserver *http.S *signalled = true gserver.GracefulStop() hserver.Shutdown(context.Background()) - // TODO(runcom): enable this after https://github.com/kubernetes/kubernetes/pull/51377 - //sserver.StopStreamServer() + sserver.StopStreamServer() sserver.StopExitMonitor() if err := sserver.Shutdown(); err != nil { logrus.Warnf("error shutting down main service %v", err) @@ -503,21 +502,18 @@ func main() { } }() - // TODO(runcom): enable this after https://github.com/kubernetes/kubernetes/pull/51377 - //streamServerCloseCh := service.StreamingServerCloseChan() + streamServerCloseCh := service.StreamingServerCloseChan() serverExitMonitorCh := service.ExitMonitorCloseChan() select { - // TODO(runcom): enable this after https://github.com/kubernetes/kubernetes/pull/51377 - //case <-streamServerCloseCh: + case <-streamServerCloseCh: case <-serverExitMonitorCh: case <-serverCloseCh: } service.Shutdown() - // TODO(runcom): enable this after https://github.com/kubernetes/kubernetes/pull/51377 - //<-streamServerCloseCh - //logrus.Debug("closed stream server") + <-streamServerCloseCh + logrus.Debug("closed stream server") <-serverExitMonitorCh logrus.Debug("closed exit monitor") <-serverCloseCh