-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
使用北极星作为服务发现时,在注册多个grpc client时,启动报错:concurrent map iteration and map write #3361
Comments
目前服务为Task模式,启动时使用discovery 链接多个grpc服务,其中有部分服务属于同一个实例(endpoint一致) |
The current service is in Task mode. Discovery is used to link multiple grpc services when starting. Some of the services belong to the same instance (the endpoints are consistent). |
完整错误栈 goroutine 1 [runnable]: goroutine 36 [chan receive]: goroutine 10 [select]: goroutine 24 [select]: goroutine 26 [chan receive]: goroutine 14 [chan receive]: goroutine 50 [select]: goroutine 72 [select]: goroutine 73 [select]: goroutine 74 [select]: goroutine 75 [select]: goroutine 76 [select]: goroutine 77 [select]: goroutine 25 [IO wait]: goroutine 44 [chan receive]: goroutine 147 [select]: goroutine 106 [select]: goroutine 107 [select]: goroutine 108 [select]: goroutine 48 [select]: goroutine 105 [select]: goroutine 82 [select]: goroutine 109 [select]: goroutine 110 [select]: goroutine 111 [select]: goroutine 137 [IO wait]: goroutine 140 [select]: goroutine 141 [select]: goroutine 144 [select]: goroutine 166 [select]: goroutine 139 [IO wait]: goroutine 47 [select]: goroutine 148 [select]: goroutine 118 [select]: goroutine 119 [select]: goroutine 120 [select]: goroutine 123 [select]: goroutine 124 [select]: goroutine 125 [select]: goroutine 126 [select]: goroutine 152 [runnable]: goroutine 180 [select]: goroutine 179 [runnable]: goroutine 149 [select]: goroutine 150 [select]: goroutine 165 [select]: goroutine 163 [runnable]: goroutine 164 [select]: goroutine 27 [select]: goroutine 153 [select]: goroutine 154 [select]: goroutine 155 [select]: goroutine 181 [select]: goroutine 182 [select]: goroutine 158 [select]: goroutine 159 [select]: goroutine 160 [select]: goroutine 194 [runnable]: |
Can you help fix it directly |
What happened:
INFO msg=watcher's ctx cancel : context canceled
INFO msg=[resolver] update instances: [{"id":"7e55bf0237ad7a213c338824f08a89552fa2a1fb","name":"bv_media_server.grpc","version":"","metadata":{"env":"prod","env_id":"0","env_name":"","env_tag":"","protocol":"grpc","version":"","weight":"100"},"endpoints":["grpc://golden-us04.domob.cn:9789"]},{"id":"d742c26c247bbc377f8a99ac9c10e402f04da209","name":"bv_media_server.grpc","version":"","metadata":{"env":"prod","env_id":"0","env_name":"","env_tag":"","protocol":"grpc","version":"","weight":"100"},"endpoints":["grpc://golden-us03.domob.cn:9789"]}]
INFO msg=[resolver] update instances: [{"id":"7e55bf0237ad7a213c338824f08a89552fa2a1fb","name":"bv_media_server.grpc","version":"","metadata":{"env":"prod","env_id":"0","env_name":"","env_tag":"","protocol":"grpc","version":"","weight":"100"},"endpoints":["grpc://golden-us04.domob.cn:9789"]},{"id":"d742c26c247bbc377f8a99ac9c10e402f04da209","name":"bv_media_server.grpc","version":"","metadata":{"env":"prod","env_id":"0","env_name":"","env_tag":"","protocol":"grpc","version":"","weight":"100"},"endpoints":["grpc://golden-us03.domob.cn:9789"]}]
fatal error: concurrent map iteration and map write
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
goroutine 170 [running]:
github.com/go-kratos/kratos/v2/registry.(*ServiceInstance).Equal(0xc00089f630, {0x1636220?, 0xc00089f630})
/home/gitlab-runner/go/pkg/mod/github.com/go-kratos/kratos/v2@v2.7.3/registry/registry.go:88 +0x225
google.golang.org/grpc/attributes.(*Attributes).Equal(0x16092a0?, 0xc00067c260)
/home/gitlab-runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/attributes/attributes.go:96 +0x1b1
google.golang.org/grpc/resolver.addressMapEntryList.find(...)
/home/gitlab-runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/resolver/map.go:64
google.golang.org/grpc/resolver.(*AddressMap).Get(0xc000b5d9d8?, {{0xc000028047, 0x19}, {0xc00067a138, 0x12}, 0xc00067c260, 0x0, {0x0, 0x0}})
/home/gitlab-runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/resolver/map.go:75 +0x185
google.golang.org/grpc/balancer/base.(*baseBalancer).UpdateClientConnState(0xc000c91f00, {{{0xc000c91e80, 0x2, 0x2}, {0xc00093e9c0, 0x2, 0x2}, 0x0, 0x0}, {0x0, ...}})
/home/gitlab-runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/balancer/base/balancer.go:125 +0x4a5
google.golang.org/grpc/internal/balancer/gracefulswitch.(*Balancer).UpdateClientConnState(0xffffffffffffffff?, {{{0xc000c91e80, 0x2
Environment:
kratos -v
):go version
):cat /etc/os-release
):The text was updated successfully, but these errors were encountered: