kitex icon indicating copy to clipboard operation
kitex copied to clipboard

连接被关闭时没有return err "connection has been closed wait read"

Open KafuuEriri opened this issue 2 years ago • 3 comments

客户端请求服务端时,connection被关闭,服务端未返回err 客户端代码

streamCli, err := cliebt.CreateStreamTransport(h.ctx, req)
	if err != nil {
		klog.CtxErrorf(h.ctx, "create stream transport to young server failed with error: %s", err.Error())
		return
	}

	klog.CtxInfof(h.ctx, "create stream transport to young server success")
	go func() {
		h.ReportTaskResult()
	}()

在客户端日志中,显示

create stream transport to young server success

而在服务端日志中,打印出

WARNING transport: http2Server.HandleStreams failed to read frame: connection has been closed wait read

我查询到日志的来源是https://github.com/cloudwego/kitex/blob/1a8100228bfc41a8da8ef6f196d1fd2b4b643dfc/pkg/remote/trans/nphttp2/grpc/http2_server.go#L412

KafuuEriri avatar Nov 06 '23 08:11 KafuuEriri

看起来是client关闭了连接,你可以用tcpdump抓包确认下

YangruiEmma avatar Nov 07 '23 11:11 YangruiEmma

看起来是client关闭了连接,你可以用tcpdump抓包确认下

这个错误是偶发的很难复现。是否可能因为没有配置server.WithReadWriteTimeout 导致使用默认的时间而超时

KafuuEriri avatar Nov 08 '23 06:11 KafuuEriri

@KafuuEriri That's not likely to be the cause. I guess there might be some issues related to grpc but it's hard to confirm. If you have this issue again, please tell me with the tcpdump.

Marina-Sakai avatar Nov 14 '23 08:11 Marina-Sakai

close due to no further response

GuangmingLuo avatar Apr 07 '25 06:04 GuangmingLuo