Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: reqstat record keys may duplicate if concurrency level is high #1491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Chion82
Copy link

@Chion82 Chion82 commented Sep 21, 2020

In ngx_http_reqstat_module:

  • Root of the red-black tree may change when inserting a new record if rotation occurs. ctx->sh->rbtree.root is NOT read-only.
  • The process of retrieving the tree root is not protected by mutex lock, which may introduce race condition.

In some rare cases, when the concurrency level is high enough,
ngx_http_reqstat_rbtree_lookup() may fail to find an existing node and allocate a new one. This will cause repeated keys in the reqstat output.

@CLAassistant
Copy link

CLAassistant commented Sep 21, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants