spacewander commented on a change in pull request #3682:
URL: https://github.com/apache/apisix/pull/3682#discussion_r583429123



##########
File path: apisix/balancer/roundrobin.lua
##########
@@ -18,12 +18,19 @@
 local roundrobin  = require("resty.roundrobin")
 local core = require("apisix.core")
 local nkeys = core.table.nkeys
+local pairs = pairs
 
 
 local _M = {}
 
 
 function _M.new(up_nodes, upstream)
+    local safe_limit = 0
+    for _, weight in pairs(up_nodes) do
+        -- the weight can be zero
+        safe_limit = safe_limit + weight + 1

Review comment:
       The number of possible retry won't be larger than `weight + 1`.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to