Yiyiyimu commented on a change in pull request #4191:
URL: https://github.com/apache/apisix/pull/4191#discussion_r660154147



##########
File path: apisix/core/config_etcd.lua
##########
@@ -545,7 +564,24 @@ local function _automatic_fetch(premature, self)
 
             local ok, err = sync_data(self)
             if err then
-                if err ~= "timeout" and err ~= "Key not found"
+                if string.find(err, err_etcd_unhealthy_all) then
+                    local reconnected = false
+                    while err and not reconnected do
+                        local backoff_duration, backoff_factor, backoff_step = 
1, 2, 10
+                        for _ = 0, backoff_step, 1 do

Review comment:
       Thanks for remind! Fixed

##########
File path: apisix/core/config_etcd.lua
##########
@@ -568,7 +568,7 @@ local function _automatic_fetch(premature, self)
                     local reconnected = false
                     while err and not reconnected do
                         local backoff_duration, backoff_factor, backoff_step = 
1, 2, 10
-                        for _ = 0, backoff_step, 1 do
+                        for _ = 1, backoff_step, 1 do

Review comment:
       Thanks for reminding! Fixed

##########
File path: apisix/core/config_etcd.lua
##########
@@ -568,7 +568,7 @@ local function _automatic_fetch(premature, self)
                     local reconnected = false
                     while err and not reconnected do
                         local backoff_duration, backoff_factor, backoff_step = 
1, 2, 10
-                        for _ = 0, backoff_step, 1 do
+                        for _ = 1, backoff_step, 1 do

Review comment:
       @tokers PTAL

##########
File path: apisix/core/config_etcd.lua
##########
@@ -545,7 +564,24 @@ local function _automatic_fetch(premature, self)
 
             local ok, err = sync_data(self)
             if err then
-                if err ~= "timeout" and err ~= "Key not found"
+                if string.find(err, err_etcd_unhealthy_all) then
+                    local reconnected = false
+                    while err and not reconnected do
+                        local backoff_duration, backoff_factor, backoff_step = 
1, 2, 10

Review comment:
       I'm not so familiar with the production environment. Do you have some 
recommendations, like 8?




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