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/16 08:31:00 UTC

[GitHub] [apisix] okaybase opened a new pull request #4830: perf(limit-count): don't return plugin inner error info to caller

okaybase opened a new pull request #4830:
URL: https://github.com/apache/apisix/pull/4830


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   don't return limit-count inner error info(e.g. invalid redis password or invalid redis DB index) to caller
   
   ### 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 commented on a change in pull request #4830: perf(limit-count): don't return plugin inner error info to caller

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



##########
File path: apisix/plugins/limit-count.lua
##########
@@ -188,7 +188,7 @@ function _M.access(conf, ctx)
         if conf.allow_degradation then
             return
         end
-        return 500, {error_msg = "failed to limit count: " .. err}

Review comment:
       Let's fix the message above: `core.log.error("failed to limit req: ", err)`

##########
File path: t/plugin/limit-count-redis2.t
##########
@@ -130,8 +130,6 @@ passed
 GET /hello
 --- error_code eval
 500
---- response_body

Review comment:
       Need to check error_log




-- 
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] okaybase commented on a change in pull request #4830: chore(limit-count): don't return plugin inner error info to caller

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



##########
File path: apisix/plugins/limit-count.lua
##########
@@ -184,11 +184,11 @@ function _M.access(conf, ctx)
             return conf.rejected_code
         end
 
-        core.log.error("failed to limit req: ", err)
+        core.log.error("failed to limit count: ", err)
         if conf.allow_degradation then
             return
         end
-        return 500, {error_msg = "failed to limit count: " .. err}
+        return 500, {error_msg = "..."}

Review comment:
       okay, thanks~ done~




-- 
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 #4830: chore(limit-count): don't return plugin inner error info to caller

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



##########
File path: apisix/plugins/limit-count.lua
##########
@@ -184,11 +184,11 @@ function _M.access(conf, ctx)
             return conf.rejected_code
         end
 
-        core.log.error("failed to limit req: ", err)
+        core.log.error("failed to limit count: ", err)
         if conf.allow_degradation then
             return
         end
-        return 500, {error_msg = "failed to limit count: " .. err}
+        return 500, {error_msg = "..."}

Review comment:
       Err, I should make it clear. What about `{error_msg = "failed to limit count"}`?




-- 
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] okaybase commented on a change in pull request #4830: chore(limit-count): don't return plugin inner error info to caller

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



##########
File path: apisix/plugins/limit-count.lua
##########
@@ -184,11 +184,11 @@ function _M.access(conf, ctx)
             return conf.rejected_code
         end
 
-        core.log.error("failed to limit req: ", err)
+        core.log.error("failed to limit count: ", err)
         if conf.allow_degradation then
             return
         end
-        return 500, {error_msg = "failed to limit count: " .. err}
+        return 500, {error_msg = "..."}

Review comment:
       okay, thanks~ done~




-- 
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 #4830: chore(limit-count): don't return plugin inner error info to caller

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


   


-- 
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 #4830: perf(limit-count): don't return plugin inner error info to caller

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



##########
File path: t/plugin/limit-count-redis2.t
##########
@@ -130,8 +130,6 @@ passed
 GET /hello
 --- error_code eval
 500
---- response_body

Review comment:
       Let's check the error_log




-- 
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 #4830: chore(limit-count): don't return plugin inner error info to caller

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



##########
File path: apisix/plugins/limit-count.lua
##########
@@ -184,11 +184,11 @@ function _M.access(conf, ctx)
             return conf.rejected_code
         end
 
-        core.log.error("failed to limit req: ", err)
+        core.log.error("failed to limit count: ", err)
         if conf.allow_degradation then
             return
         end
-        return 500, {error_msg = "failed to limit count: " .. err}

Review comment:
       For compatibility, we still need to return a `{error_msg = "..."}`




-- 
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] okaybase commented on a change in pull request #4830: chore(limit-count): don't return plugin inner error info to caller

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



##########
File path: t/plugin/limit-count-redis2.t
##########
@@ -130,8 +130,6 @@ passed
 GET /hello
 --- error_code eval
 500
---- response_body

Review comment:
       okay, thanks~ done~

##########
File path: apisix/plugins/limit-count.lua
##########
@@ -188,7 +188,7 @@ function _M.access(conf, ctx)
         if conf.allow_degradation then
             return
         end
-        return 500, {error_msg = "failed to limit count: " .. err}

Review comment:
       okay, thanks~ done~




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