envoyproxy/envoy

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

Open

#3,011 创建于 2018年4月5日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)C++ (5,373 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (27,997 star)
PR 合并指标
 (平均合并 8天) (30 天内合并 378 个 PR)

描述

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.

贡献者指南