Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

networking - How to disable route timeout in Envoy?

I'm trying to use http2/grpc streaming, but my connection cuts off in 15 seconds. The documentation on the timeout setting says to set the timeout to 0. However when I do this then Envoy throws an error on startup complaining that 0 isn't a valid value for the Duration type.

How do I disable the route timeout?

Here is my Envoy config .yml

    admin:
      access_log_path: "/dev/null"
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 8801
    
    static_resources:
      listeners:
      - address:
          socket_address:
            address: 0.0.0.0
            port_value: 11001
        filter_chains:
        - filters:
          - name: envoy.filters.network.http_connection_manager
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
              stat_prefix: ingress_http
              http_filters:
              - name: envoy.filters.http.router
              route_config:
                name: grpc_route
                virtual_hosts:
                - name: grpc_service
                  domains: ["*"]
                  routes:
                  - name: grpc_proxy
                    match:
                      prefix: "/"
                    route:
                      timeout: 0 # How do I disable the timeout?
                      auto_host_rewrite: true
                      prefix_rewrite: "/"
                      cluster: grpc

      clusters:
      - name: grpc
        connect_timeout: 0.25s
        type: STRICT_DNS
        lb_policy: round_robin
        http2_protocol_options: {}
        dns_lookup_family: V4_ONLY
        load_assignment:
          cluster_name: grpc
          endpoints:
          - lb_endpoints:
            - endpoint:
                address: 
                  socket_address: 
                    address: mygrpcservice
                    port_value: 50061 

question from:https://stackoverflow.com/questions/65897760/how-to-disable-route-timeout-in-envoy

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You almost got it. The only change you need to make is to go from an integer to a duration. So rather than "0", you need to specify "0s" for zero seconds.

I verified this by setting timeout: 0s in your config.yaml and everything started up.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...