Skip to content

bugfix: Semaphore not cleaned up on request timeout - #2426

Closed
dark264sh wants to merge 1 commit into
openresty:masterfrom
dark264sh:fix_semaphore
Closed

dark264sh wants to merge 1 commit into
openresty:masterfrom
dark264sh:fix_semaphore

Conversation

@dark264sh

Copy link
Copy Markdown

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.

#2422

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

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.

openresty#2422
@zhuizhuhaomeng

Copy link
Copy Markdown
Contributor

Thanks.
I will review it ASAP.

@zhuizhuhaomeng

Copy link
Copy Markdown
Contributor

@dark264sh Since the semaphore can be access across requests.
We should not register cleanup at the request level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants