Merge pull request #1150 from unistack-org/grpc_race

fix map race condition in grpc server
This commit is contained in:
Asim Aslam 2020-02-01 00:10:46 +00:00 committed by GitHub
commit 27efbc8779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -562,11 +562,17 @@ func (g *grpcServer) Register() error {
return err
}
// make copy of metadata
md := make(meta.Metadata)
for k, v := range config.Metadata {
md[k] = v
}
// register service
node := &registry.Node{
Id: config.Name + "-" + config.Id,
Address: mnet.HostPort(addr, port),
Metadata: config.Metadata,
Metadata: md,
}
node.Metadata["broker"] = config.Broker.String()