Quellcode durchsuchen

etcdserver: make cluster checking interval shorter

Xiang Li vor 10 Jahren
Ursprung
Commit
ef6320e638
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      etcdserver/server.go

+ 5 - 2
etcdserver/server.go

@@ -62,8 +62,11 @@ const (
 	StoreClusterPrefix = "/0"
 	StoreKeysPrefix    = "/1"
 
-	purgeFileInterval      = 30 * time.Second
-	monitorVersionInterval = 5 * time.Second
+	purgeFileInterval = 30 * time.Second
+	// monitorVersionInterval should be smaller than the timeout
+	// on the connection. Or we will not be able to resue the connection
+	// (since it will timeout).
+	monitorVersionInterval = rafthttp.ConnWriteTimeout - time.Second
 
 	databaseFilename = "db"
 	// max number of in-flight snapshot messages etcdserver allows to have