aboutsummaryrefslogtreecommitdiff
path: root/weed/server
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2019-01-10 09:02:13 -0800
committerGitHub <noreply@github.com>2019-01-10 09:02:13 -0800
commite978f3aaaba844f9b8def8fa9aed7872595f3245 (patch)
tree3d000a41408651ef4d2b6331501c550387c4a5a7 /weed/server
parent2a75a36b275ea7f47a95ad2efc70be22d5ed3fe2 (diff)
parent39c745588111cebef0475f2453ee0715e0153c49 (diff)
downloadseaweedfs-e978f3aaaba844f9b8def8fa9aed7872595f3245.tar.xz
seaweedfs-e978f3aaaba844f9b8def8fa9aed7872595f3245.zip
Merge pull request #829 from PapaYofen/fix-823
Fix https://github.com/chrislusf/seaweedfs/issues/823
Diffstat (limited to 'weed/server')
-rw-r--r--weed/server/master_server_handlers_admin.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/server/master_server_handlers_admin.go b/weed/server/master_server_handlers_admin.go
index 490693d97..3a2662908 100644
--- a/weed/server/master_server_handlers_admin.go
+++ b/weed/server/master_server_handlers_admin.go
@@ -7,6 +7,7 @@ import (
"math/rand"
"net/http"
"strconv"
+ "time"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
@@ -24,7 +25,10 @@ func (ms *MasterServer) collectionDeleteHandler(w http.ResponseWriter, r *http.R
}
for _, server := range collection.ListVolumeServers() {
err := operation.WithVolumeServerClient(server.Url(), func(client volume_server_pb.VolumeServerClient) error {
- _, deleteErr := client.DeleteCollection(context.Background(), &volume_server_pb.DeleteCollectionRequest{
+ ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second))
+ defer cancel()
+
+ _, deleteErr := client.DeleteCollection(ctx, &volume_server_pb.DeleteCollectionRequest{
Collection: collection.Name,
})
return deleteErr