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