消费者由生产者通过resty_http调用127.0.0.1上的请求启动一个ngx.timer.at定时器。定时器从redis list中取出task后处理。并且视有无后续任务等情况重启定时器。当然,从redis list中弹出处理过的task。
Core was generated by `nginx: worker process '.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f280016c8ce in lj_debug_funcname (L=0x45c5efa8,
frame=<value optimized out>, name=0x7fff20b466a8) at lj_debug.c:303
303 MMS mm = bcmode_mm(bc_op(*ip));
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.132.el6.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.10.3-10.el6_4.6.x86_64 libcom_err-1.41.12-18.el6.x86_64 libgcc-4.4.7-4.el6.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 nss-softokn-freebl-3.14.3-9.el6.x86_64 openssl-1.0.1e-16.el6_5.4.x86_64 pcre-7.8-6.el6.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) where
#0 0x00007f280016c8ce in lj_debug_funcname (L=0x45c5efa8,
frame=<value optimized out>, name=0x7fff20b466a8) at lj_debug.c:303
#1 0x00007f280016d191 in lj_debug_getinfo (L=0x45c5efa8, what=0x4d4d98 "nl",
ar=0x7fff20b466a0, ext=0) at lj_debug.c:483
#2 0x000000000048b9a7 in log_wrapper (log=0x182ebf0, ident=0x4d4dda "[lua] ",
level=2, L=0x45c5efa8) at ../ngx_lua-0.9.6/src/ngx_http_lua_log.c:110
#3 0x000000000048be3c in ngx_http_lua_ngx_log (L=0x45c5efa8)
at ../ngx_lua-0.9.6/src/ngx_http_lua_log.c:58
#4 0x00007f2800164371 in lj_BC_FUNCC ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#5 0x00007f2800167d51 in lj_err_run (L=0x45c5efa8) at lj_err.c:565
#6 0x00007f2800168352 in err_msgv (L=0x45c5efa8, em=<value optimized out>)
at lj_err.c:580
#7 0x00007f28001684a5 in lj_err_optype (L=0x45c5efa8,
o=<value optimized out>, opm=<value optimized out>) at lj_err.c:616
#8 0x00007f280016be8f in lj_meta_tget (L=0x45c5efa8, o=0x47df8c08,
k=0x7fff20b46940) at lj_meta.c:141
#9 0x00007f28001647cd in lj_vmeta_tgetv ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#10 0x00000000004a0361 in ngx_http_lua_run_thread (L=0x41fc3378, r=0x182ec40,
ctx=0x1832dc8, nrets=1) at ../ngx_lua-0.9.6/src/ngx_http_lua_util.c:1103
#11 0x00000000004a753c in ngx_http_lua_socket_tcp_resume (r=0x182ec40)
at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:4277
#12 0x00000000004a19ab in ngx_http_lua_content_wev_handler (
r=<value optimized out>)
at ../ngx_lua-0.9.6/src/ngx_http_lua_contentby.c:128
#13 0x00000000004a74a1 in ngx_http_lua_socket_handle_success (
r=<value optimized out>, u=<value optimized out>)
at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:2329
#14 0x00000000004aa587 in ngx_http_lua_socket_tcp_read (r=0x182ec40,
u=0x45f1cce8) at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:1513
#15 0x00000000004aa9fb in ngx_http_lua_socket_read_handler (r=0x182ec40,
u=0x45f1cce8) at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:2167
#16 0x00000000004a7389 in ngx_http_lua_socket_tcp_handler (
ev=<value optimized out>)
at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:2119
#17 0x00000000004343ab in ngx_epoll_process_events (
cycle=<value optimized out>, timer=<value optimized out>,
flags=<value optimized out>) at src/event/modules/ngx_epoll_module.c:691
====================================================
#0 0x00007f34d0ac18ce in lj_debug_funcname (L=0x405705d8,
frame=<value optimized out>, name=0x7fff354de208) at lj_debug.c:303
303 MMS mm = bcmode_mm(bc_op(*ip));
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.132.el6.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.10.3-10.el6_4.6.x86_64 libcom_err-1.41.12-18.el6.x86_64 libgcc-4.4.7-4.el6.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 nss-softokn-freebl-3.14.3-9.el6.x86_64 openssl-1.0.1e-16.el6_5.4.x86_64 pcre-7.8-6.el6.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) where
#0 0x00007f34d0ac18ce in lj_debug_funcname (L=0x405705d8,
frame=<value optimized out>, name=0x7fff354de208) at lj_debug.c:303
#1 0x00007f34d0ac2191 in lj_debug_getinfo (L=0x405705d8, what=0x4d4d98 "nl",
ar=0x7fff354de200, ext=0) at lj_debug.c:483
#2 0x000000000048b9a7 in log_wrapper (log=0xbfdb70, ident=0x4d4dda "[lua] ",
level=2, L=0x405705d8) at ../ngx_lua-0.9.6/src/ngx_http_lua_log.c:110
#3 0x000000000048be3c in ngx_http_lua_ngx_log (L=0x405705d8)
at ../ngx_lua-0.9.6/src/ngx_http_lua_log.c:58
#4 0x00007f34d0ab9371 in lj_BC_FUNCC ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#5 0x00007f34d0abcd51 in lj_err_run (L=0x405705d8) at lj_err.c:565
#6 0x00007f34d0abd352 in err_msgv (L=0x405705d8, em=<value optimized out>)
at lj_err.c:580
#7 0x00007f34d0abd4a5 in lj_err_optype (L=0x405705d8,
o=<value optimized out>, opm=<value optimized out>) at lj_err.c:616
#8 0x00007f34d0abd522 in lj_err_optype_call (L=0x410b1db0, o=0x400000310)
at lj_err.c:643
#9 0x00007f34d0ac0188 in lj_meta_call (L=0x405705d8, func=0x44923bf8,
top=0x44923c08) at lj_meta.c:433
#10 0x00007f34d0ab9a43 in lj_vmeta_call ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#11 0x00000000004a0361 in ngx_http_lua_run_thread (L=0x406e8378, r=0xbfdbc0,
ctx=0xbdd148, nrets=1) at ../ngx_lua-0.9.6/src/ngx_http_lua_util.c:1103
#12 0x00000000004a753c in ngx_http_lua_socket_tcp_resume (r=0xbfdbc0)
at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:4277
#13 0x00000000004a19ab in ngx_http_lua_content_wev_handler (
r=<value optimized out>)
at ../ngx_lua-0.9.6/src/ngx_http_lua_contentby.c:128
#14 0x00000000004a74a1 in ngx_http_lua_socket_handle_success (
r=<value optimized out>, u=<value optimized out>)
at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:2329
#15 0x00000000004aa587 in ngx_http_lua_socket_tcp_read (r=0xbfdbc0,
u=0x4472b860) at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:1513
#16 0x00000000004aa9fb in ngx_http_lua_socket_read_handler (r=0xbfdbc0,
u=0x4472b860) at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:2167
#17 0x00000000004a7389 in ngx_http_lua_socket_tcp_handler (
ev=<value optimized out>)
at ../ngx_lua-0.9.6/src/ngx_http_lua_socket_tcp.c:2119
#18 0x000000000042d5aa in ngx_event_process_posted (
哦。对了。我在释放redis连接的时候使用的是redis:set_keepalive(0, 128)
但其实设置成其它参数也会导致问题。甚至redis:close()也一样。
谢谢