Skip to content

Not removing sleep timer when deleting a thread? #248

Closed
@aviramc

Description

@aviramc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions