Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXEC without MULTI #52

Open
bcyang opened this issue Oct 11, 2018 · 2 comments · May be fixed by #72
Open

EXEC without MULTI #52

bcyang opened this issue Oct 11, 2018 · 2 comments · May be fixed by #72

Comments

@bcyang
Copy link

bcyang commented Oct 11, 2018

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
Copy link
Author

bcyang commented Oct 11, 2018

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;

@fortrue
Copy link
Member

fortrue commented Oct 13, 2018

Thanks, Welcome Pull Reqeust

@Negashev Negashev linked a pull request Feb 3, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants