From 3cb914f7e12ad0aba82f52399282c3ffd377013e Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 10 Sep 2022 11:26:19 -0700 Subject: [PATCH] avoid dead lock --- weed/topology/data_center.go | 2 +- weed/topology/rack.go | 2 +- weed/topology/topology.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/topology/data_center.go b/weed/topology/data_center.go index 5ffbe4bb8..26d2de7d3 100644 --- a/weed/topology/data_center.go +++ b/weed/topology/data_center.go @@ -29,7 +29,7 @@ func (dc *DataCenter) GetOrCreateRack(rackName string) *Rack { } } rack := NewRack(rackName) - dc.LinkChildNode(rack) + dc.doLinkChildNode(rack) return rack } diff --git a/weed/topology/rack.go b/weed/topology/rack.go index d388e9c61..c96bf421e 100644 --- a/weed/topology/rack.go +++ b/weed/topology/rack.go @@ -47,7 +47,7 @@ func (r *Rack) GetOrCreateDataNode(ip string, port int, grpcPort int, publicUrl dn.GrpcPort = grpcPort dn.PublicUrl = publicUrl dn.LastSeen = time.Now().Unix() - r.LinkChildNode(dn) + r.doLinkChildNode(dn) for diskType, maxVolumeCount := range maxVolumeCounts { disk := NewDisk(diskType) disk.diskUsages.getOrCreateDisk(types.ToDiskType(diskType)).maxVolumeCount = int64(maxVolumeCount) diff --git a/weed/topology/topology.go b/weed/topology/topology.go index 406ee30f6..6c6fc73a4 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -267,7 +267,7 @@ func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter { } } dc := NewDataCenter(dcName) - t.LinkChildNode(dc) + t.doLinkChildNode(dc) return dc }