shreemaan-abhishek commented on code in PR #13019:
URL: https://github.com/apache/apisix/pull/13019#discussion_r2839852955


##########
apisix/plugins/limit-req.lua:
##########
@@ -122,6 +123,23 @@ local function create_limit_obj(conf)
 end
 
 
+local function gen_limit_key(conf, ctx, key)
+    local parent = conf._meta and conf._meta.parent
+    if not parent or not parent.resource_key then
+        core.log.error("failed to generate key invalid parent: ", 
core.json.encode(parent))
+        return nil
+    end
+
+    local new_key = parent.resource_key .. ':' .. 
apisix_plugin.conf_version(conf)

Review Comment:
   previous logic use `ctx.conf_version` instead of 
`apisix_plugin.conf_version`, the value of the former stays the same even if 
the consumer is recreated, however the value of conf_version changes in the 
latter method. This is the reason why limit-req test is failing as it expects 
403 in the first request itself.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to