avoid race conditions for OnPeerUpdate (#3525)

https://github.com/seaweedfs/seaweedfs/issues/3524
This commit is contained in:
Konstantin Lebedev
2022-08-26 22:18:49 +05:00
committed by GitHub
parent 4f7a1f67cd
commit e90ab4ac60
4 changed files with 14 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ func NewMessageBroker(option *MessageQueueBrokerOption, grpcDialOption grpc.Dial
MasterClient: wdclient.NewMasterClient(grpcDialOption, option.FilerGroup, cluster.BrokerType, pb.NewServerAddress(option.Ip, option.Port, 0), option.DataCenter, option.Rack, option.Masters),
filers: make(map[pb.ServerAddress]struct{}),
}
mqBroker.MasterClient.OnPeerUpdate = mqBroker.OnBrokerUpdate
mqBroker.MasterClient.SetOnPeerUpdateFn(mqBroker.OnBrokerUpdate)
go mqBroker.MasterClient.KeepConnectedToMaster()