/opt/openresty/nginx/conf/lua/api/chat/send.lua:702: in function </opt/openresty/nginx/conf/lua/api/chat/send.lua:684>, context: ngx.timer
2014/04/22 19:40:24 [error] 17044#0: lua entry thread aborted: runtime error: /opt/openresty/lualib/resty/redis.lua:0: attempt to perform arithmetic on a table value
stack traceback:
coroutine 0:
/opt/openresty/lualib/resty/redis.lua: in function 'rpush'local function send_to_save (red, msg_key)
if debug then ngx.log(ngx.ERR,'[debug] send_to_save(rpush) with data='..msg_key) end
local res, err = red:rpush( red_prefix..':msg:to:save', msg_key )
if err then
ngx.log(ngx.ERR, '[debug] send_to_save(rpush) FAILED with data=',msg_key, 'err=',err)
end
end
看起来像是触发了 LuaJIT 的 JIT 编译器里的某个 bug. 你能尝试一下最新的 OpenResty 1.5.12.1 RC3 版吗?
http://openresty.org/download/ngx_openresty-1.5.12.1rc3.tar.gz
这个版本里的 LuaJIT 包含了许多最新的 JIT 编译器里的 bug 修复。
多谢!
-agentzh
2014/04/23 16:40:38 [error] 29283#0: *53941 lua entry thread aborted: runtime error: /opt/openresty/nginx/conf/lua/api/foo/bar.lua:523: bad argument #1 to 'ipairs' (table expected, got boolean)
stack traceback:
coroutine 0:
[C]: in function 'ipairs' if rev then
res, err = red:zrevrangebyscore(zset , "("..e_lfts, 0, 'withscores', 'limit', 0, 10 )
else
res, err = red:zrangebyscore(zset , "("..e_lfts, e_lts, 'withscores', 'limit', 0, 10 )
end
for k,v in ipairs(res) dores, err = red:zrevrangebyscore(zset , "("..e_lfts, 0, 'withscores', 'limit', 0, 10 )
if err then
ngx.log(ngx.ERR, 'redis err: ',err)
else
-- 這裡開始處理res的table內容
end
出現這樣的錯誤我的代碼:if rev then
res, err = red:zrevrangebyscore(zset , "("..e_lfts, 0, 'withscores', 'limit', 0, 10 )
else
res, err = red:zrangebyscore(zset , "("..e_lfts, e_lts, 'withscores', 'limit', 0, 10 )
end
for k,v in ipairs(res) do