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 2020/09/26 01:18:59 UTC

[GitHub] [apisix] membphis commented on a change in pull request #2299: bugfix: use etcd:watchcancel to reduce connections in etcdv3

membphis commented on a change in pull request #2299:
URL: https://github.com/apache/apisix/pull/2299#discussion_r495361243



##########
File path: apisix/core/config_etcd.lua
##########
@@ -123,6 +124,11 @@ local function waitdir(etcd_cli, key, modified_index, timeout)
         res, err = res_func()
     end
 
+    if http_cli then
+        etcd_cli:watchcancel(http_cli)

Review comment:
       need test case.
   
   we can use this way: write a log and confirm it in test case

##########
File path: apisix/core/config_etcd.lua
##########
@@ -246,24 +248,9 @@ local function sync_data(self)
         return true
     end
 
-    -- for fetch the etcd index
-    local key_res, _ = getkey(self.etcd_cli, self.key)
-
     local dir_res, err = waitdir(self.etcd_cli, self.key, self.prev_index + 1, self.timeout)
-
     log.info("waitdir key: ", self.key, " prev_index: ", self.prev_index + 1)
     log.info("res: ", json.delay_encode(dir_res, true))
-    if err == "timeout" then

Review comment:
       why we delete this code block? it is useful for etcd `v2`. please confirm this




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