Feature Request: be able to set Connection header in some cases
#3011 aperta il 5 apr 2018
Metriche repository
- Star
- (27.997 star)
- Metriche merge PR
- (Merge medio 8g) (378 PR mergiate in 30 g)
Descrizione
Description:
We're using Envoy as an inbound proxy in front of many of our services. For a given service, there will be some number of hosts, each running Envoy to receive client connections. During something like a deploy, some percentage of these hosts' services will go down. We've observed that when this happens, Envoy will send back 503s to clients, but will keep the TCP connection open, and not set Connection: close. Consequently, the clients hold the connection open, and keep getting errors, instead of giving up and trying a different host. As some additional context, we're using Envoy for TLS termination, so there's value in having one Envoy per service host, as opposed to a single envoy somewhere routing between the backends.
In my experimentation, I was unable to set a Connection header, either with a response_headers_to_add or envoy.lua filter. I asked about this on the Envoy Users list and Matt Klein confirmed that it's not possible (https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/envoy-users/Gop0a7S-vN0/eqvvRCKxBgAJ).
It would help our deployment out a lot if we could signal to clients that they should stop trying to connect if there are no clusters alive. I could imagine:
- a way to have filters that set this header based on the HTTP response code
- a config to take down a listener or set headers in it based on % of healthy clusters
Simply sending back a TCP Reset could probably also solve this in our particular case.