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



##########
File path: apisix/core/config_etcd.lua
##########
@@ -92,17 +105,29 @@ local function waitdir(etcd_cli, key, modified_index, 
timeout)
         return nil, nil, "not inited"
     end
 
-    local res, err = etcd_cli:waitdir(key, modified_index, timeout)
+    local opts = {}
+    opts.start_revision = modified_index
+    opts.timeout = timeout
+    local res_fun, fun_err = etcd_cli:watchdir(key, opts)
+    if not res_fun then
+        return nil, fun_err
+    end
+
+    -- try twice to skip create info
+    local res, err = res_fun()
+    if not res or not res.result or not res.result.events then
+        res, err = res_fun()
+    end
+

Review comment:
       in etcd v3, the 1st response of watch is the success of watch creation, 
useless to us




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