This is an automated email from the ASF dual-hosted git repository.

agile6v pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 9a6fc51  bugfix: raise error when none of the configured etcd can be 
connected (#1608)
9a6fc51 is described below

commit 9a6fc51d295578f613af448bdce6087bf1f88a8f
Author: 罗泽轩 <[email protected]>
AuthorDate: Fri May 22 20:47:47 2020 +0800

    bugfix: raise error when none of the configured etcd can be connected 
(#1608)
    
    Close #1561.
---
 bin/apisix | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/apisix b/bin/apisix
index 506af06..f2cee30 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -768,6 +768,7 @@ local function init_etcd(show_output)
 
     local host_count = #(yaml_conf.etcd.host)
 
+    local etcd_ok = false
     for index, host in ipairs(yaml_conf.etcd.host) do
 
         local is_success = true
@@ -799,9 +800,14 @@ local function init_etcd(show_output)
         end
 
         if is_success then
+            etcd_ok = true
             break
         end
     end
+
+    if not etcd_ok then
+        error("none of the configured etcd works well")
+    end
 end
 _M.init_etcd = init_etcd
 

Reply via email to