lua-io-nginx-module
lua-io-nginx-module copied to clipboard
Unsafe usage of memory from request pool
Unfortunately my PR (#8) is insufficient to fully solve the memory issues with this module. It helps but it doesnt solve it completely, is still possible for requests to finish removing memory in use or about to be used by tasks.
To quote the lua module: https://github.com/openresty/lua-nginx-module/blob/c9a0808c89219f74e4d20cef44a322a1bbe72df3/src/ngx_http_lua_worker_thread.c#L69
* Re-implement ngx_thread_task_alloc to avoid alloc from request pool
* since the request may exit before worker thread finish.
Fortunately its hence now possible to implement this module in lua!
Native nginx uses r->blocked
to prevent request freeing which might be the better way to do this. Although unsure if this is safe to do in all nginx lua contexts.