emissary icon indicating copy to clipboard operation
emissary copied to clipboard

Ambassador does not work well for gRPC streaming

Open ngrigoriev opened this issue 5 years ago • 6 comments

Describe the bug gRPC streams are somewhat different from traditional unary API calls. Often there may be long idle periods. gRPC and Envoy have sophisticated logic for managing gRPC timeout without conflicting with the timeouts for "normal" unary requests (gRPC or not). Specifically, I am talking about the "grpc-timeout" client header, "max_grpc_timeout" route property (if not set, the header mentioned before is not taken into account) and "grpc_timeout_offset" route property. Ambassador only offers "timeout_ms" which is translated into Envoy's "timeout" route property. This means that no special handling for gRPC streams is possible.

As result, the only way to support the streams correctly is to disable the timeout, which may not be a good idea in general. Plus, this simply does not provide enough flexibility.

To Reproduce Steps to reproduce the behavior:

  1. Start gRPC stream
  2. Let it idle for more than 3s
  3. The stream will be closed by Ambassador

Expected behavior If Ambassador provided more configuration properties, it could be supported in much more elegant way.

Versions (please complete the following information):

  • Ambassador: [master]

ngrigoriev avatar Jan 17 '20 18:01 ngrigoriev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 21 '20 19:03 stale[bot]

can it be reopened?

washanhanzi avatar Apr 15 '20 05:04 washanhanzi

i am seing gRPC Error (14, upstream connect error or disconnect/reset before headers. reset reason: connection failure) for dart clients while go clients just work fine

yannick avatar Jul 08 '20 20:07 yannick

I'd also like to bump this issue, would there be a way to set a stream_idle_timeout ? https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/protocol.proto#envoy-v3-api-field-config-core-v3-httpprotocoloptions-idle-timeout

blhagadorn avatar Sep 07 '21 22:09 blhagadorn

Thanks for this issue. If you're available to discuss or help with implementation please join our Emissary Contributors Meeting .

cindymullins-dw avatar Jan 27 '23 18:01 cindymullins-dw

Is there any known workaround for this limitation? There are numerous threads online (example) backing up that Envoy's stream_idle_timeout needs to be configured/disabled for gRPC workflows. I have not yet found a way to do so via Ambassador.

dimo414 avatar Feb 09 '24 22:02 dimo414