diff options
Diffstat (limited to 'weed/topology')
| -rw-r--r-- | weed/topology/allocate_volume.go | 8 | ||||
| -rw-r--r-- | weed/topology/topology_vacuum.go | 5 |
2 files changed, 3 insertions, 10 deletions
diff --git a/weed/topology/allocate_volume.go b/weed/topology/allocate_volume.go index ff0bbce42..66b1b3af5 100644 --- a/weed/topology/allocate_volume.go +++ b/weed/topology/allocate_volume.go @@ -2,12 +2,10 @@ package topology import ( "context" - "google.golang.org/grpc" - "time" - "github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb" "github.com/chrislusf/seaweedfs/weed/storage" + "google.golang.org/grpc" ) type AllocateVolumeResult struct { @@ -17,10 +15,8 @@ type AllocateVolumeResult struct { func AllocateVolume(dn *DataNode, grpcDialOption grpc.DialOption, vid storage.VolumeId, option *VolumeGrowOption) error { return operation.WithVolumeServerClient(dn.Url(), grpcDialOption, func(client volume_server_pb.VolumeServerClient) error { - ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second)) - defer cancel() - _, deleteErr := client.AssignVolume(ctx, &volume_server_pb.AssignVolumeRequest{ + _, deleteErr := client.AssignVolume(context.Background(), &volume_server_pb.AssignVolumeRequest{ VolumdId: uint32(vid), Collection: option.Collection, Replication: option.ReplicaPlacement.String(), diff --git a/weed/topology/topology_vacuum.go b/weed/topology/topology_vacuum.go index 71d3ead76..840821efa 100644 --- a/weed/topology/topology_vacuum.go +++ b/weed/topology/topology_vacuum.go @@ -16,10 +16,7 @@ func batchVacuumVolumeCheck(grpcDialOption grpc.DialOption, vl *VolumeLayout, vi for index, dn := range locationlist.list { go func(index int, url string, vid storage.VolumeId) { err := operation.WithVolumeServerClient(url, grpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error { - ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second)) - defer cancel() - - resp, err := volumeServerClient.VacuumVolumeCheck(ctx, &volume_server_pb.VacuumVolumeCheckRequest{ + resp, err := volumeServerClient.VacuumVolumeCheck(context.Background(), &volume_server_pb.VacuumVolumeCheckRequest{ VolumdId: uint32(vid), }) if err != nil { |
