aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_decode.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-08-22 14:12:23 -0700
committerchrislu <chris.lu@gmail.com>2022-08-22 14:12:23 -0700
commit676e27c589a99691ba78f010a067898d89f764ac (patch)
treecee659e16990e035b0f7a3c2ed994f1ea77cf9c2 /weed/shell/command_ec_decode.go
parent601ba5fb680eb028080160c857feda9b7044ab56 (diff)
downloadseaweedfs-676e27c589a99691ba78f010a067898d89f764ac.tar.xz
seaweedfs-676e27c589a99691ba78f010a067898d89f764ac.zip
shell: stop long running jobs if lock is lost
Diffstat (limited to 'weed/shell/command_ec_decode.go')
-rw-r--r--weed/shell/command_ec_decode.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/shell/command_ec_decode.go b/weed/shell/command_ec_decode.go
index aebc20579..4c92d1a2f 100644
--- a/weed/shell/command_ec_decode.go
+++ b/weed/shell/command_ec_decode.go
@@ -89,6 +89,11 @@ func (c *commandEcDecode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
}
func doEcDecode(commandEnv *CommandEnv, topoInfo *master_pb.TopologyInfo, collection string, vid needle.VolumeId) (err error) {
+
+ if !commandEnv.isLocked() {
+ return fmt.Errorf("lock is lost")
+ }
+
// find volume location
nodeToEcIndexBits := collectEcNodeShardBits(topoInfo, vid)