Problems setting Connection headers on cluster responses

167 views
Skip to first unread message

max.bu...@airbnb.com

unread,
Apr 5, 2018, 5:17:47 PM4/5/18
to envoy-users
Hello fellow envoy users!

I've run into some unusual behavior around setting the "Connection" header on responses from Envoy. The context is that I have Envoy acting as an inbound proxy, and have noticed that when no clusters are healthy, although it returns a 503, it keeps the connection open to the client. This results in the client continuing to send requests to the Envoy instance that has no healthy backends, and thus the client doesn't give up and go find another Envoy instance in our environment to communicate with. To deal with this, I'd like to be able to set "Connection: close" on this kind of response. I tried doing this with the Lua filter, and found that I could set most headers, but not Connection. While investigating this further, I also found that the "response_headers_to_add" feature of configuration was also unable to set Connection.

Basic example of my Lua configuration:
{ "name": "envoy.lua", "config": { "inline_code": "function envoy_on_response(response_handle)\n  response_handle:headers():replace(\"connection\", \"close\")\nend" }

Is there a way to set this header in responses from Envoy? If not, is there some equivalent feature that could provide what I'm looking for--connection-close-based or tcp-based circuit breaking for clients who are talking to an Envoy instance with no healthy clusters?

Any guidance or help here is appreciated!

Sincerely,
Max

Matt Klein

unread,
Apr 5, 2018, 6:06:49 PM4/5/18
to max.bu...@airbnb.com, envoy-users
The connection header is special and handled directly by Envoy. It can't be set by filters. 

I would treat this as a feature request. Can you open an issue and we can discuss there?

--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users+unsubscribe@googlegroups.com.
To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/b7cb5152-6904-44fc-9353-fb182ddede34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages