fix: ctx being contaminated due to a new feature of openresty 1.19#3105
Merged
Conversation
…eing contaminated
moonming
requested changes
Dec 22, 2020
moonming
left a comment
Member
There was a problem hiding this comment.
I don't think this is a good title of PR, and we need test cases
Member
|
related issue: #3103 |
membphis
requested changes
Dec 22, 2020
| end | ||
| ngx_exit(-1) | ||
| end | ||
| ngx.ctx = nil |
| ngx_ctx.api_ctx = api_ctx | ||
| end | ||
| local api_ctx = core.tablepool.fetch("api_ctx", 0, 32) | ||
| ngx_ctx.api_ctx = api_ctx |
Member
Author
spacewander
reviewed
Dec 23, 2020
membphis
approved these changes
Dec 23, 2020
Closed
tokers
approved these changes
Dec 23, 2020
spacewander
approved these changes
Dec 24, 2020
Member
|
@nic-chen CI failed |
moonming
approved these changes
Dec 24, 2020
Member
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A new feature has been added in OpenResty 1.19.3.1:
Shared ngx.ctx among SSL_* phases and the following phases.In the ssl phase, ctx is created but not cleared.
In the access phase, it is judged that if ctx already exists, it will not be created.
This causes a same client to access an
httpsservice and then access anotherhttpservice, it will be reused the previous ctx, resulting in this bug.fix #3079
Pre-submission checklist:
we could add test cases later for quick fix. we could track it by test: add TLS testcase in apisix #3103
we don't need to modify docs for this change.