如下的代码,在调用is_include多次后,偶尔会出现刚创建的coroutine还没resume就是dead status。
errors.log没有出现"out of memory"的luaL_error信息。
请问大家要如何调试?(openresty v1.4.3.6)
function iter(list)
local co = coroutine.create(function()
for i = 1, #list do
coroutine.yield(list[i])
end
end)
if coroutine.status(co) == "dead" then
ngx.log(ngx.ERR, "create a dead coroutine")
end
return function()
local ok,res = coroutine.resume(co)
if ok then
return nil
end
return res
end
end
function is_include(list)
for i in iter(list) do
if i == value then return true end
end
return false
end