Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kitex client在长时间没调用的时候报错 #1654

Open
godsoul opened this issue Dec 31, 2024 · 4 comments
Open

kitex client在长时间没调用的时候报错 #1654

godsoul opened this issue Dec 31, 2024 · 4 comments

Comments

@godsoul
Copy link

godsoul commented Dec 31, 2024

	GMClient, err = gm.NewClient("callgame",
		client.WithHostPorts(rpcSever), //内网测试
		client.WithTransportProtocol(transport.GRPC),
	)

客户端连接代码,当空闲时间久了,在调用服务,就报错,报错信息如下
remote or network error: connection error: desc = "transport is closing"
报错以后也不会重连,调用就一直报错,服务端是 GRPC 服务
image

@ppzqh
Copy link
Contributor

ppzqh commented Jan 2, 2025

kitex什么版本?建议升级到最新版本测试一下

@godsoul
Copy link
Author

godsoul commented Jan 2, 2025

目前是v0.10.3,老版本是可能出现这种问题吗?之前线上用也没发现。升级到哪个版本比较好

@ppzqh
Copy link
Contributor

ppzqh commented Jan 2, 2025

最新版本就行,可以看到具体的错误原因。这个报错大概率就是对端关闭连接了。

@ppzqh
Copy link
Contributor

ppzqh commented Jan 2, 2025

client可以配置下 WithGRPCKeepaliveParams,time 设置成 10s 验证下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants