mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid dead lock
This commit is contained in:
parent
ebef579ebb
commit
3cb914f7e1
|
@ -29,7 +29,7 @@ func (dc *DataCenter) GetOrCreateRack(rackName string) *Rack {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rack := NewRack(rackName)
|
rack := NewRack(rackName)
|
||||||
dc.LinkChildNode(rack)
|
dc.doLinkChildNode(rack)
|
||||||
return rack
|
return rack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ func (r *Rack) GetOrCreateDataNode(ip string, port int, grpcPort int, publicUrl
|
||||||
dn.GrpcPort = grpcPort
|
dn.GrpcPort = grpcPort
|
||||||
dn.PublicUrl = publicUrl
|
dn.PublicUrl = publicUrl
|
||||||
dn.LastSeen = time.Now().Unix()
|
dn.LastSeen = time.Now().Unix()
|
||||||
r.LinkChildNode(dn)
|
r.doLinkChildNode(dn)
|
||||||
for diskType, maxVolumeCount := range maxVolumeCounts {
|
for diskType, maxVolumeCount := range maxVolumeCounts {
|
||||||
disk := NewDisk(diskType)
|
disk := NewDisk(diskType)
|
||||||
disk.diskUsages.getOrCreateDisk(types.ToDiskType(diskType)).maxVolumeCount = int64(maxVolumeCount)
|
disk.diskUsages.getOrCreateDisk(types.ToDiskType(diskType)).maxVolumeCount = int64(maxVolumeCount)
|
||||||
|
|
|
@ -267,7 +267,7 @@ func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dc := NewDataCenter(dcName)
|
dc := NewDataCenter(dcName)
|
||||||
t.LinkChildNode(dc)
|
t.doLinkChildNode(dc)
|
||||||
return dc
|
return dc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue