Description
Hi!
Debugging an issue that I have with my Lua code, I ran across this issue - the function ngx_http_lua_del_thread doesn't remove the sleep timer of the thread in case the thread waits for sleep.
Is this really a bug? And in a more general perspective - shouldn't ngx_http_lua_del_thread call coctx->cleanup for cleaning up any action in which it is stuck?
I've ran across this bug when debugging an issue that might also be interesting - I have a Lua thread that sleeps, and under certain conditions I want the request to end without waiting for this thread to end, so I call ngx.exit. This works okay, but under a stress of roughly 1000 requests per seconds, it crashes. The core dump shows various location in each crash (sometimes in Nginx code and sometimes in LuaJIT), and this looks like a memory corruption that might occur if, for example, a timer event of an already finished request would occur...
Regards
Aviram