envoyproxy / envoyproxy/envoy

Feature Request: be able to set Connection header in some cases

Open
#3,011 3 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 22h
Merged PRs (30d)
430

Description

*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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.