GithubHelp home page GithubHelp logo

Comments (7)

johnlanni avatar johnlanni commented on July 18, 2024

是不是配置了 proxy-next-upstream-timeout 呢,如果超过这个时间,是不会进行重试的,这个nginx也是这样的

from higress.

xionghao1985 avatar xionghao1985 commented on July 18, 2024

是不是配置了 proxy-next-upstream-timeout 呢,如果超过这个时间,是不会进行重试的,这个nginx也是这样的

613cf2b6e76a6d5ac543bff3ef61f73

from higress.

johnlanni avatar johnlanni commented on July 18, 2024

@SpecialYang 确认下目前实现,我看envoy的实现机制和nginx还是有差异,必须指定per-try-timeout比总的超时时间短才会做超时重试,相当于如果配置了timeout注解,就等价于配置了nginx的proxy-next-upstream-timeout :https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#config-http-filters-router-x-envoy-retry-on

from higress.

johnlanni avatar johnlanni commented on July 18, 2024

if timeout, err := annotations.ParseIntASAP(perRetryTimeout); err == nil {
retryConfig.perRetryTimeout = &types.Duration{
Seconds: int64(timeout),
}
}

现在将proxy-next-upstream-timeout映射到perRetryTimeout,会和nginx ingress行为不一致。
我觉得可以加个注解来指定perRetryTimeout,如果注解未指定时,则默认设置为比路由超时小(比如减1秒),这样来做兼容

nginx的行为可以参考:
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-timeouts
https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream_timeout

如果设置了proxy-next-upstream-timeout,当超过这个timeout后不会重试,不设置则超时会一直重试。虽然一般最佳实践也是把这个值配成和路由超时时间一致。

envoy的行为可以参考:

https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto.html#config-route-v3-retrypolicy

当每次重试超过per_try_timeout时,会进行重试,但如果整体超时时间超过路由的timeout,就不会重试。

from higress.

SpecialYang avatar SpecialYang commented on July 18, 2024

那nginx这个proxy-next-upstream-timeout 注解有什么意义呢?跟它的名字都有点违背。

from higress.

johnlanni avatar johnlanni commented on July 18, 2024

那nginx这个proxy-next-upstream-timeout 注解有什么意义呢?跟它的名字都有点违背。

是指请求总的处理时间超过这个timeout后,就不再进行重试

from higress.

johnlanni avatar johnlanni commented on July 18, 2024

@SpecialYang 我们在文档中说明下,proxy-next-upstream-timeout 这个注解和nginx的差异,并告知用户如果在配置基于超时重试时,必须做此配置,并配置的比higress.io/timeout的值要小

https://higress.io/zh-cn/docs/user/annotation-use-case#%E9%87%8D%E8%AF%95

如跟 @SpecialYang 线下沟通,这里如果完全兼容 nginx ingress,可能导致开启基于 timeout 做重试时,引入重试风暴的问题,nginx ingress 目前的默认配置也有这样的隐患。所以我们不再考虑这个功能完全兼容。

对于 proxy-next-upstream-timeout 这个注解的名字来说,当作是每次重试的 timeout,从字面理解上也是更合理的,符合用户直觉

from higress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.