Search code examples
network-programminggrpchttp2envoyproxy

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 


Solution

  • 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.