lua-resty-core
lua-resty-core copied to clipboard
bugfix: Semaphore not cleaned up on request timeout
After a ngx.semaphore.wait() call, if the current request is terminated by Nginx due to client_header_timeout or client_body_timeout, the corresponding post() is never executed. As a result, all subsequent attempts to wait() on the same semaphore hang until they time out, because the semaphore count was never restored.
https://github.com/openresty/lua-nginx-module/issues/2422
I hereby granted the copyright of the changes in this pull request to the authors of this lua-resty-core project.