-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed as not planned
Labels
questionFurther information is requestedFurther information is requested
Description
反馈一个作为用户有点迷惑的地方,我在联调一个耗时较长(约30s)的接口时,发现在 ctx 中设置的超时不生效,永远是2秒报超时,查看源码发现是 kratos 封装的 grpc 默认带了 2s 超时参数,通过 UnaryIntercepter 的方式 ”帮助“ 用户设置超时。
我觉得 grpc.WithTimeout 给 grpc.Dial 带来了一些歧义,一是在 Dial 设置的 timeout 却在 Perform 时生效, 二是 Dial 和 Perform 都有 ctx 入参可以控制超时,grpc.WithTimeout 却通过一个隐蔽的方式设置了一个”最小超时“,所以很容易写出一个超时bug,也会给用户造成困扰
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested