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

重启nacos服务端后编辑配置,客户端ListenConfig收不到消息 #694

Open
SuKaiFei opened this issue Dec 7, 2023 · 3 comments

Comments

@SuKaiFei
Copy link

SuKaiFei commented Dec 7, 2023

What version of nacos-sdk-go are you using?

2.2.4

What version of nacos-sever are you using?

.3.0

What version of Go are you using (go version)?

1.21.4

What operating system (Linux, Windows, …) and version?

macOS 13.6.1

What did you do?

重启nacos服务端后编辑配置,客户端ListenConfig收不到消息。
ps:经测试Java版本SDK没问题

What did you expect to see?

ListenConfig收到消息

What did you see instead?

客户端ListenConfig没有任何反应

日志信息

2023-12-07T18:36:01.402+0800	ERROR	rpc/grpc_client.go:193	connectionId 1701945340348_192.168.108.71_51815 request stream error, switch server, error=rpc error: code = Canceled desc = stream terminated by RST_STREAM with error code: CANCEL
2023-12-07T18:36:01.403+0800	INFO	rpc/rpc_client.go:322	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 try to re connect to a new server, server is not appointed, will choose a random server.
2023-12-07T18:36:01.411+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 1 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51856->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:01.517+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 2 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51858->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:01.722+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 3 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51861->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:02.027+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 4 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51864->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:02.433+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 5 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51866->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:05.937+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 6 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = DeadlineExceeded desc = context deadline exceeded
2023-12-07T18:36:06.543+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 7 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51884->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:07.250+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 8 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51890->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:08.055+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 9 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51894->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:08.962+0800	WARN	rpc/rpc_client.go:353	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 fail to connect server, after trying 10 times, last try server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, error=server check request failed , err:rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp 127.0.0.1:51897->127.0.0.1:7890: read: connection reset by peer"
2023-12-07T18:36:12.371+0800	ERROR	rpc/grpc_client.go:244	1701945373885_192.168.108.71_51901 Unsupported payload type
2023-12-07T18:36:12.440+0800	INFO	rpc/rpc_client.go:335	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 success to connect a server {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, connectionId=1701945373885_192.168.108.71_51901
2023-12-07T18:36:12.440+0800	INFO	rpc/rpc_client.go:339	config-0-85cf675e-89ea-461a-b697-ef2cd43e7f11 abandon prev connection, server is {serverIp:192.168.160.118 serverPort:8848 serverGrpcPort:9848}, connectionId is 1701945340348_192.168.108.71_51815

个人排查分析
https://github.com/nacos-group/nacos-sdk-go/blob/master/clients/config_client/config_client.go#L556C1-L556C1
image
注释掉555的continue,重启nacos服务端后编辑配置,客户端ListenConfig可以正常收到消息。

@SuKaiFei SuKaiFei changed the title 重启nacos服务端后编辑config,客户端ListenConfig收不到消息 重启nacos服务端后编辑配置,客户端ListenConfig收不到消息 Dec 7, 2023
@binbin0325
Copy link
Member

重启后,配置有变更吗?

@SuKaiFei
Copy link
Author

SuKaiFei commented Dec 7, 2023

重启后,配置有变更吗?

没有,就是docker-compose restart操作

@yiboGit
Copy link

yiboGit commented Jun 19, 2024

我也遇到了相同的问题,nacos重启之后,nacos client grpc重连,但是修改配置,无法监听到配置变更

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

No branches or pull requests

3 participants