From 460a2de6e328bbe46512d16eb3950181cc4f2912 Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Mon, 25 Feb 2019 15:16:45 +0000 Subject: [PATCH] Don't hang Envoy when result set is empty As noted in #4868 we can sometimes cause Envoy to hang if one or more upstream has no instances available since Envoy won't continue processing xDS for listeners until it has all the endpoints resolved they'd be proxying to. I _assume_ that this is correct and that by getting an explicit empty result Envoy will continue to resolve the config and just fail with a 503 if that upstream is connected. This needs testing though and also ensuring that it doesn't cause any other side-effects. --- agent/xds/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/xds/server.go b/agent/xds/server.go index 1a32b1c7670d..5eff260173d6 100644 --- a/agent/xds/server.go +++ b/agent/xds/server.go @@ -346,7 +346,7 @@ func (t *xDSType) SendIfNew(cfgSnap *proxycfg.ConfigSnapshot, version uint64, no if err != nil { return err } - if resources == nil || len(resources) == 0 { + if resources == nil { // Nothing to send yet return nil }