envoyproxy/envoy

Delay ADS stream until XDS cluster warming

Open

#7253 aperta il 12 giu 2019

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)C++ (5373 fork)batch import
api/v3bughelp wanted

Metriche repository

Star
 (27.997 star)
Metriche merge PR
 (Merge medio 8g) (378 PR mergiate in 30 g)

Descrizione

Currently the ADS stream is started immediately after static load completes:

https://github.com/envoyproxy/envoy/blob/master/source/common/upstream/cluster_manager_impl.cc#L283

When used with STRICT_DNS, this means that the gRPC stream keeps attempting to connect until DNS resolves, which can exacerbate startup delays due to DNS issues: the stream will continuously attempt to connect, building up the retry backoff counter. By the time DNS finally resolves, the next attempt might be scheduled several seconds into the future. As a result, a 5 second DNS delay (eg due to a timeout) might result in delaying startup by >10s.

While this slowdown isn't a major issue, it's caused short-ish DNS issues to cause significant deployment delays for us.

Conceptually the fix sounds like it would be to defer ADS stream start until the associated cluster warms (eg wait for first DNS resolution), but I'm not sure how easy it would be to express that with the current init helper.

Guida contributor