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 2021/08/22 09:30:44 UTC

[GitHub] [apisix] nic-chen opened a new pull request #4867: fix: the issue that plugins in global rule may be cached to route

nic-chen opened a new pull request #4867:
URL: https://github.com/apache/apisix/pull/4867


   ### What this PR does / why we need it:
   
   fix the issue that plugins in global rule may be cached to route
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander merged pull request #4867: fix: the issue that plugins in global rule may be cached to route

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #4867:
URL: https://github.com/apache/apisix/pull/4867


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on a change in pull request #4867: fix: the issue that plugins in global rule may be cached to route

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4867:
URL: https://github.com/apache/apisix/pull/4867#discussion_r693588677



##########
File path: apisix/init.lua
##########
@@ -694,7 +694,7 @@ function _M.http_log_phase()
     end
 
     core.ctx.release_vars(api_ctx)
-    if api_ctx.plugins and api_ctx.plugins ~= core.empty_tab then
+    if api_ctx.plugins and core.table.nkeys(api_ctx.plugins) > 0 then

Review comment:
       Empty plugins also need to be released.

##########
File path: apisix/plugin.lua
##########
@@ -307,7 +307,7 @@ function _M.filter(conf, plugins, route_conf)
         trace_plugins_info_for_debug(nil)
         -- when 'plugins' is given, always return 'plugins' itself instead
         -- of another one
-        return plugins or core.empty_tab
+        return plugins or {}

Review comment:
       ```suggestion
           return plugins or core.tablepool.fetch("plugins", 0, 0)
   ```




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] membphis commented on a change in pull request #4867: fix: the issue that plugins in global rule may be cached to route

Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #4867:
URL: https://github.com/apache/apisix/pull/4867#discussion_r693689901



##########
File path: t/node/global-rule.t
##########
@@ -369,3 +369,122 @@ GET /hello
 changed
 --- no_error_log
 [error]
+
+
+
+=== TEST 17: delete global rules, ensure no stale data remain

Review comment:
       bad title, need to more detail




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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