From 73cbf17d8f0529668f4bfeef766bfa46b2589346 Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 17 Aug 2020 10:44:14 +1000 Subject: [PATCH] cmd/contour: forcibly terminate the xDS server on shutdown Fix a regression from #2780, where the Contour xDS server would fail to stop because it is waiting for xDS connections to drain (they won't drain). This updates #2780. Signed-off-by: James Peach --- cmd/contour/serve.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/contour/serve.go b/cmd/contour/serve.go index a77d6165590..afc2f3cafce 100644 --- a/cmd/contour/serve.go +++ b/cmd/contour/serve.go @@ -437,7 +437,12 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error { go func() { <-stop - rpcServer.GracefulStop() + + // We don't use GracefulStop here because envoy + // has long-lived hanging xDS requests. There's no + // mechanism to make those pending requests fail, + // so we forcibly terminate the TCP sessions. + rpcServer.Stop() }() return rpcServer.Serve(l)