From 1cb659019e6c7d64e5aa4382de09584905a4dd7b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 31 Aug 2026 11:39:09 -0700 Subject: [PATCH] shell: reset noLock in the admin script dispatcher too Three dispatchers reuse one CommandEnv: the interactive shell, the master's maintenance script runner, and the plugin worker's admin script handler. The third is exempt anyway because it calls ForceNoLock, so this changes nothing today -- it keeps the rule the same everywhere rather than resting on that exemption staying in place. --- weed/plugin/worker/admin_script_handler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/plugin/worker/admin_script_handler.go b/weed/plugin/worker/admin_script_handler.go index 5643956d0..d6ff69cca 100644 --- a/weed/plugin/worker/admin_script_handler.go +++ b/weed/plugin/worker/admin_script_handler.go @@ -290,6 +290,11 @@ func (h *AdminScriptHandler) Execute(ctx context.Context, request *plugin_pb.Exe continue } found = true + // The env is reused for every command in the script, and noLock + // belongs to the invocation that set it. ForceNoLock already exempts + // this path, so this changes nothing today -- it keeps the rule the + // same in all three dispatchers rather than resting on that. + commandEnv.SetNoLock(false) if err := command.Do(cmd.Args, commandEnv, output); err != nil { msg := fmt.Sprintf("%s: %v", cmd.Name, err) errorMessages = append(errorMessages, msg)