diff --git a/.gitignore b/.gitignore index c9a9027a069..cd2fd010b28 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ testdb build cmake-build-* +build-* diff --git a/src/commands/cmd_list.cc b/src/commands/cmd_list.cc index 1a9f5d03dfc..6b97eb1557a 100644 --- a/src/commands/cmd_list.cc +++ b/src/commands/cmd_list.cc @@ -894,10 +894,9 @@ class CommandLPos : public Commander { PosSpec spec_; }; -REDIS_REGISTER_COMMANDS(List, MakeCmdAttr("blpop", -3, "write no-script blocking", 1, -2, 1), - MakeCmdAttr("brpop", -3, "write no-script blocking", 1, -2, 1), - MakeCmdAttr("blmpop", -5, "write no-script blocking", - CommandBLMPop::keyRangeGen), +REDIS_REGISTER_COMMANDS(List, MakeCmdAttr("blpop", -3, "write blocking", 1, -2, 1), + MakeCmdAttr("brpop", -3, "write blocking", 1, -2, 1), + MakeCmdAttr("blmpop", -5, "write blocking", CommandBLMPop::keyRangeGen), MakeCmdAttr("lindex", 3, "read-only", 1, 1, 1), MakeCmdAttr("linsert", 5, "write slow", 1, 1, 1), MakeCmdAttr("llen", 2, "read-only", 1, 1, 1), diff --git a/src/commands/cmd_server.cc b/src/commands/cmd_server.cc index c85ad501b60..7a93f4a2602 100644 --- a/src/commands/cmd_server.cc +++ b/src/commands/cmd_server.cc @@ -1343,7 +1343,7 @@ REDIS_REGISTER_COMMANDS(Server, MakeCmdAttr("auth", 2, "read-only o MakeCmdAttr("slowlog", -2, "read-only", NO_KEY), MakeCmdAttr("perflog", -2, "read-only", NO_KEY), MakeCmdAttr("client", -2, "read-only", NO_KEY), - MakeCmdAttr("monitor", 1, "read-only no-multi", NO_KEY), + MakeCmdAttr("monitor", 1, "read-only no-multi no-script", NO_KEY), MakeCmdAttr("shutdown", 1, "read-only no-multi no-script", NO_KEY), MakeCmdAttr("quit", 1, "read-only", NO_KEY), MakeCmdAttr("scan", -2, "read-only", NO_KEY), diff --git a/src/commands/commander.h b/src/commands/commander.h index d5d65fa454a..bb5674dbf86 100644 --- a/src/commands/commander.h +++ b/src/commands/commander.h @@ -329,9 +329,13 @@ inline uint64_t ParseCommandFlags(const std::string &description, const std::str flags |= kCmdNoDBSizeCheck; else if (flag == "slow") flags |= kCmdSlow; - else if (flag == "blocking") + else if (flag == "blocking") { flags |= kCmdBlocking; - else { + + // blocking commands should always be no-script + // TODO: we can relax this restriction if scripting becomes non-exclusive + flags |= kCmdNoScript; + } else { std::cout << fmt::format("Encountered non-existent flag '{}' in command {} in command attribute parsing", flag, cmd_name) << std::endl;