config: add fallback timeout to tls_inspector#7853
config: add fallback timeout to tls_inspector#7853lambdai wants to merge 2 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
|
http inspector listener has the exact same issue. Will apply to http_inspector once approved. |
|
@lizan |
|
Do you really need that level of granularity though? Even in Istio, we are most likely to only ever set the same timeout value for every filter chain. There is actually no scenario where we would set the timeout for one chain but not for the other because we do not know the protocol apriori. IMO it is easy to go from a global option to a more fine grained option (local overrides global), than it is to go from a local only option to a global option, IMO. I dont mind either implementation - which ever is quicker works! |
api/envoy/config/filter/listener/tls_inspector/v2alpha1/tls_inspector.proto
Show resolved
Hide resolved
|
@lizan Sorry I may misinterpret your comment. I total agree if there is a single timeout for the listener. What I am proposed is that if any listener filter cannot follow the fallback timeout, that listener filter can block the onAccept, until envoy decide to close the connection |
|
Let me pull up my WIP branch to a Draft PR soon.
We don't do this today, a |
Actually this is what continueFilterChain(false) do. |
|
I read through #7859 It pushes the flag continueOnListenerFiltersTimeout to listener but we do have something.
|
|
I believe #7859 will eventually address the my concern. Close this PR |
I'm spotting this working on tests, should be fixed. |
|
@lizan Thanks! |
Description:
Istio is seeing mysql connection rejected when deprecating bind_to_port=false listeners by migrating to listener with a large amount of filter chains.
tls_inspector always expecting some bytes from client. Otherwise it block the filterchain match.
There are some application protocols that requires server send the handshake packet first. E.g. MySQL.
That means if there are two filter chains, one requires tls_inpsector listener filter and the other filter chain expecting mysql traffic
can never listed in the same listener.
If MySQL client connects, the connection is handled by envoy listener and blocked at tls_inspector::onAccept()
before trying to match any filter chain.
One of the solution is to allow tls_inspector fallback to determine it as plain text after a certain timeout (e.g. 10ms). (Not implemented yet, prototype https://github.com/silentdai/envoy/tree/toimpl)
Back compatibility: if the tls_inspector config proto is not setting fallback timeout field, the default timeout is infinity.
Fix #7195
Risk Level: LOW
Testing:
Docs Changes: TODO
Release Notes: TODO