predixy icon indicating copy to clipboard operation
predixy copied to clipboard

`EXEC without MULTI`

Open bcyang opened this issue 5 years ago • 2 comments

When supportTransaction() is false, WATCH and MULTI commands are forbidden.

EXEC should also be forbidden. Otherwise, MULTI command gets dropped (by predixy) but EXEC gets passed along, causing redis to return EXEC without MULTI error.

bcyang avatar Oct 11 '18 05:10 bcyang

just one line change

diff --git a/src/Handler.cpp b/src/Handler.cpp
index b29bdf4..a35c4b2 100644
--- a/src/Handler.cpp
+++ b/src/Handler.cpp
@@ -639,6 +639,7 @@ bool Handler::preHandleRequest(Request* req, const String& key)
         return true;
     case Command::Watch:
     case Command::Multi:
+    case Command::Exec:
         if (!mProxy->supportTransaction()) {
             directResponse(req, Response::ForbidTransaction);
             return true;

bcyang avatar Oct 11 '18 05:10 bcyang

Thanks, Welcome Pull Reqeust

fortrue avatar Oct 13 '18 00:10 fortrue