You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/22 14:21:41 UTC

[GitHub] [apisix] membphis commented on a change in pull request #3105: fix: the bug that traffic is forwarded to wrong upstream due to ctx being contaminated

membphis commented on a change in pull request #3105:
URL: https://github.com/apache/apisix/pull/3105#discussion_r547304087



##########
File path: apisix/init.lua
##########
@@ -334,12 +335,8 @@ end
 
 function _M.http_access_phase()
     local ngx_ctx = ngx.ctx
-    local api_ctx = ngx_ctx.api_ctx
-
-    if not api_ctx then
-        api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
-        ngx_ctx.api_ctx = api_ctx
-    end
+    local api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
+    ngx_ctx.api_ctx = api_ctx

Review comment:
       ditto

##########
File path: apisix/init.lua
##########
@@ -185,6 +185,7 @@ function _M.http_ssl_phase()
         end
         ngx_exit(-1)
     end
+    ngx.ctx = nil

Review comment:
       need comments




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org