Skip to content

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

Open
Chion82 wants to merge 1 commit intoalibaba:masterfrom
Chion82:master
Open

bugfix: reqstat record keys may duplicate if concurrency level is high#1491
Chion82 wants to merge 1 commit intoalibaba:masterfrom
Chion82:master

Conversation

@Chion82
Copy link
Copy Markdown

@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
Copy Markdown

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