aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-05-21 02:09:22 -0700
committerChris Lu <chris.lu@gmail.com>2021-05-21 02:09:22 -0700
commit0b00edfc3b3291d97bd699adfc5ad15b69dd9947 (patch)
treeb2e3a8c02fb20f707185b559d2682ded0a50180f
parent085a61cb8fdfc5d3f80de2768f5fd3081b873d64 (diff)
downloadseaweedfs-0b00edfc3b3291d97bd699adfc5ad15b69dd9947.tar.xz
seaweedfs-0b00edfc3b3291d97bd699adfc5ad15b69dd9947.zip
waits in case master lost connection
-rw-r--r--weed/wdclient/masterclient.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go
index e39b9dfdf..da812dc22 100644
--- a/weed/wdclient/masterclient.go
+++ b/weed/wdclient/masterclient.go
@@ -36,6 +36,9 @@ func NewMasterClient(grpcDialOption grpc.DialOption, clientType string, clientHo
}
func (mc *MasterClient) GetMaster() string {
+ for mc.currentMaster == "" {
+ time.Sleep(time.Duration(rand.Int31n(200)) * time.Millisecond)
+ }
return mc.currentMaster
}