avoid infinite loop WaitUntilConnected() (#3431)

https://github.com/seaweedfs/seaweedfs/issues/3421
This commit is contained in:
Konstantin Lebedev
2022-08-12 01:03:26 +03:00
committed by GitHub
parent 53b601616c
commit 4d4cd0948d
2 changed files with 5 additions and 7 deletions

View File

@@ -276,11 +276,9 @@ func (ms *MasterServer) startAdminScripts() {
go commandEnv.MasterClient.KeepConnectedToMaster()
go func() {
commandEnv.MasterClient.WaitUntilConnected()
for {
time.Sleep(time.Duration(sleepMinutes) * time.Minute)
if ms.Topo.IsLeader() {
if ms.Topo.IsLeader() && ms.MasterClient.GetMaster() != "" {
shellOptions.FilerAddress = ms.GetOneFiler(cluster.FilerGroupName(*shellOptions.FilerGroup))
if shellOptions.FilerAddress == "" {
continue