-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: ctx being contaminated due to a new feature of openresty 1.19 #3105
Conversation
…eing contaminated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good title of PR, and we need test cases
related issue: #3103 |
@@ -185,6 +185,7 @@ function _M.http_ssl_phase() | |||
end | |||
ngx_exit(-1) | |||
end | |||
ngx.ctx = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
ngx_ctx.api_ctx = api_ctx | ||
end | ||
local api_ctx = core.tablepool.fetch("api_ctx", 0, 32) | ||
ngx_ctx.api_ctx = api_ctx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
@nic-chen CI failed |
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
https
service and then access anotherhttp
service, 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.