Created
March 22, 2011 22:46
-
-
Save agladysh/882263 to your computer and use it in GitHub Desktop.
MULTI/EXEC crashes inside PIPELINE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' | |
local tstr = import 'lua-nucleo/tstr.lua' { 'tstr' } -- Lua value to string | |
local N = 1 | |
local P = function(...) print(N .. ":", tstr(assert(...))); N = N + 1 end | |
-------------------------------------------------------------------------------- | |
-- Connect to Redis | |
-------------------------------------------------------------------------------- | |
local R = assert(sidereal.connect("localhost", 6379)) | |
-------------------------------------------------------------------------------- | |
-- Fill data | |
-------------------------------------------------------------------------------- | |
R:set("MYKEY", "value") | |
-------------------------------------------------------------------------------- | |
-- This works | |
-------------------------------------------------------------------------------- | |
P (R:multi()) | |
--> 1: "OK" | |
P (R:get("MYKEY")) | |
--> 2: "QUEUED" | |
P (R:exec()) | |
--> 3: "value" | |
-------------------------------------------------------------------------------- | |
-- This does not | |
-------------------------------------------------------------------------------- | |
R:pipeline() | |
P (R:multi()) | |
--> 4: {} | |
P (R:get("MYKEY")) | |
--> 5: {} | |
P (R:exec()) | |
--> | |
--[[ | |
lua: /usr/local/share/lua/5.1//sidereal.lua:1062: handling multiple responses failed(2) | |
stack traceback: | |
[C]: in function 'error' | |
/usr/local/share/lua/5.1//sidereal.lua:1062: in function </usr/local/share/lua/5.1//sidereal.lua:1058> | |
(tail call): ? | |
check_pipeline_multi.lua:48: in main chunk | |
[C]: ? | |
--]] | |
R:send_pipeline() | |
P (R:get_response()) | |
--> (not reached) | |
P (R:get_response()) | |
--> (not reached) | |
P (R:get_response()) | |
--> (not reached) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment