-
Notifications
You must be signed in to change notification settings - Fork 874
Description
Describe the bug
双向流调用 流的rpc 方法时,ctx,如果传 context.Background(),会偶发的一直卡在
github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/grpc.(*Stream).waitOnHeader+0xc4 github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/grpc/transport.go:324
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
WithRPCTimeout is only effective for unary methods
是不是双向流只有在
Call(ctx context.Context, callOptions ...callopt.Option) (stream OmsService_CallClient, err error)
通过ctx 传 context.WithTimeout(context.Background(), 10*time.Second)
或者 callopt.Option 传超时控制?
`import "github.com/cloudwego/kitex/client/callopt"
rsp, err := cli.YourMethod(ctx, req,
callopt.WithConnectTimeout(100 * time.Millisecond))
callopt.WithRPCTimeout(2 * time.Second))
`
Screenshots
# 0x11b6564 github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/grpc.(*Stream).waitOnHeader+0xc4 /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/grpc/transport.go:324
# 0x11b6664 github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/grpc.(*Stream).RecvCompress+0x24 /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/grpc/transport.go:339
# 0x146dd6d github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*clientConn).GetRecvCompress+0x2d /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/client_conn.go:175
# 0x146e5ee github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*cliTransHandler).Read+0x20e /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/client_handler.go:71
# 0x147a0dc github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*clientStream).RecvMsg+0x31c /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/stream.go:244
# 0x1479a48 github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*grpcClientStream).RecvMsg+0x68 /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/pkg/remote/trans/nphttp2/stream.go:211
# 0xe9f8e3 github.com/cloudwego/kitex/internal/stream.(*StreamingConfig).BuildRecvInvokeChain.func1+0x43 /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/internal/stream/stream_option.go:58
# 0x15ad5b8 github.com/cloudwego/kitex/client.(*grpcStream).RecvMsg+0x78 /go/pkg/mod/github.com/cloudwego/kitex@v0.14.1/client/stream.go:330
Kitex version:
v0.14.1