Add raft server access mutex to avoid races (#3503)

This commit is contained in:
Patrick Schmidt
2022-08-24 18:49:05 +02:00
committed by GitHub
parent f7e4359b59
commit 7b424a54dc
5 changed files with 72 additions and 25 deletions

View File

@@ -16,6 +16,10 @@ func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request)
infos := make(map[string]interface{})
infos["Up Time"] = time.Now().Sub(startTime).String()
infos["Max Volume Id"] = ms.Topo.GetMaxVolumeId()
ms.Topo.RaftServerAccessLock.RLock()
defer ms.Topo.RaftServerAccessLock.RUnlock()
if ms.Topo.RaftServer != nil {
args := struct {
Version string