You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by al...@apache.org on 2023/10/27 01:23:58 UTC

[apisix] branch release/3.6 updated: feat: release 3.6.1 (#10383)

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

alinsran pushed a commit to branch release/3.6
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/release/3.6 by this push:
     new 1cc1b196c feat: release 3.6.1 (#10383)
1cc1b196c is described below

commit 1cc1b196cd6ecdf814f9b8872b771d40089376b0
Author: Ashish Tiwari <as...@gmail.com>
AuthorDate: Fri Oct 27 06:53:52 2023 +0530

    feat: release 3.6.1 (#10383)
---
 CHANGELOG.md                                                   |  9 +++++++++
 apisix/core/config_util.lua                                    |  2 +-
 apisix/core/version.lua                                        |  2 +-
 apisix/upstream.lua                                            |  2 +-
 docs/en/latest/building-apisix.md                              |  2 +-
 docs/en/latest/config.json                                     |  2 +-
 docs/zh/latest/CHANGELOG.md                                    |  9 +++++++++
 docs/zh/latest/building-apisix.md                              |  2 +-
 docs/zh/latest/config.json                                     |  2 +-
 rockspec/{apisix-master-0.rockspec => apisix-3.6.1-0.rockspec} |  7 ++++---
 rockspec/apisix-master-0.rockspec                              |  3 ++-
 t/control/healthcheck.t                                        | 10 +++++-----
 t/discovery/consul.t                                           |  4 ++--
 t/discovery/consul_kv.t                                        |  4 ++--
 t/node/healthcheck-discovery.t                                 |  2 +-
 t/node/healthcheck-leak-bugfix.t                               |  4 ++--
 t/node/healthcheck.t                                           |  1 +
 t/node/priority-balancer/health-checker.t                      |  6 +++---
 18 files changed, 47 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce5f1d017..b5c54b45d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,7 @@ title: Changelog
 
 ## Table of Contents
 
+- [3.6.1](#361)
 - [3.6.0](#360)
 - [3.5.0](#350)
 - [3.4.0](#340)
@@ -73,6 +74,14 @@ title: Changelog
 - [0.7.0](#070)
 - [0.6.0](#060)
 
+## 3.6.1
+
+### Bugfixes
+
+- fix: keep healthcheck target state when upstream changes:
+    - [#10307](https://github.com/apache/apisix/pull/10307)
+    - [#10312](https://github.com/apache/apisix/pull/10312)
+
 ## 3.6.0
 
 ### Change
diff --git a/apisix/core/config_util.lua b/apisix/core/config_util.lua
index 7e57ed402..7313e0116 100644
--- a/apisix/core/config_util.lua
+++ b/apisix/core/config_util.lua
@@ -114,7 +114,7 @@ function _M.fire_all_clean_handlers(item)
         clean_handler.f(item)
     end
 
-    item.clean_handlers = nil
+    item.clean_handlers = {}
 end
 
 
diff --git a/apisix/core/version.lua b/apisix/core/version.lua
index ff16402d3..9165886e6 100644
--- a/apisix/core/version.lua
+++ b/apisix/core/version.lua
@@ -20,5 +20,5 @@
 -- @module core.version
 
 return {
-    VERSION = "3.6.0"
+    VERSION = "3.6.1"
 }
diff --git a/apisix/upstream.lua b/apisix/upstream.lua
index 0ff82fea8..d8e3f3a98 100644
--- a/apisix/upstream.lua
+++ b/apisix/upstream.lua
@@ -83,7 +83,7 @@ _M.set = set_directly
 local function release_checker(healthcheck_parent)
     local checker = healthcheck_parent.checker
     core.log.info("try to release checker: ", tostring(checker))
-    checker:clear()
+    checker:delayed_clear(3)
     checker:stop()
 end
 
diff --git a/docs/en/latest/building-apisix.md b/docs/en/latest/building-apisix.md
index e4804eac4..8f1d26956 100644
--- a/docs/en/latest/building-apisix.md
+++ b/docs/en/latest/building-apisix.md
@@ -54,7 +54,7 @@ curl https://raw.githubusercontent.com/apache/apisix/master/utils/install-depend
 Save the APISIX version to an environment variable to be used next:
 
 ```shell
-APISIX_VERSION='3.6.0'
+APISIX_VERSION='3.6.1'
 ```
 
 Clone the APISIX source code of this version into a new directory `apisix-APISIX_VERSION`:
diff --git a/docs/en/latest/config.json b/docs/en/latest/config.json
index e1c8391f2..3ada4db43 100644
--- a/docs/en/latest/config.json
+++ b/docs/en/latest/config.json
@@ -1,5 +1,5 @@
 {
-  "version": "3.6.0",
+  "version": "3.6.1",
   "sidebar": [
     {
       "type": "category",
diff --git a/docs/zh/latest/CHANGELOG.md b/docs/zh/latest/CHANGELOG.md
index a3ce74cca..06c4cd3b9 100644
--- a/docs/zh/latest/CHANGELOG.md
+++ b/docs/zh/latest/CHANGELOG.md
@@ -23,6 +23,7 @@ title: CHANGELOG
 
 ## Table of Contents
 
+- [3.6.1](#361)
 - [3.6.0](#360)
 - [3.5.0](#350)
 - [3.4.0](#340)
@@ -73,6 +74,14 @@ title: CHANGELOG
 - [0.7.0](#070)
 - [0.6.0](#060)
 
+## 3.6.1
+
+### Bugfix
+
+- 修复:当上游发生变化时保持健康检查目标状态:
+    - [#10312](https://github.com/apache/apisix/pull/10312)
+    - [#10307](https://github.com/apache/apisix/pull/10307)
+
 ## 3.6.0
 
 ### Change
diff --git a/docs/zh/latest/building-apisix.md b/docs/zh/latest/building-apisix.md
index abeac2033..7da870acd 100644
--- a/docs/zh/latest/building-apisix.md
+++ b/docs/zh/latest/building-apisix.md
@@ -53,7 +53,7 @@ curl https://raw.githubusercontent.com/apache/apisix/master/utils/install-depend
 然后,创建一个目录并设置环境变量 `APISIX_VERSION`:
 
 ```shell
-APISIX_VERSION='3.6.0'
+APISIX_VERSION='3.6.1'
 mkdir apisix-${APISIX_VERSION}
 ```
 
diff --git a/docs/zh/latest/config.json b/docs/zh/latest/config.json
index 1ff81e6b6..8990b01ef 100644
--- a/docs/zh/latest/config.json
+++ b/docs/zh/latest/config.json
@@ -1,5 +1,5 @@
 {
-  "version": "3.6.0",
+  "version": "3.6.1",
   "sidebar": [
     {
       "type": "category",
diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-3.6.1-0.rockspec
similarity index 96%
copy from rockspec/apisix-master-0.rockspec
copy to rockspec/apisix-3.6.1-0.rockspec
index ec99128f3..360941079 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-3.6.1-0.rockspec
@@ -16,12 +16,12 @@
 --
 
 package = "apisix"
-version = "master-0"
+version = "3.6.1-0"
 supported_platforms = {"linux", "macosx"}
 
 source = {
     url = "git://github.com/apache/apisix",
-    branch = "master",
+    branch = "3.6.1",
 }
 
 description = {
@@ -39,7 +39,8 @@ dependencies = {
     "lua-resty-balancer = 0.04",
     "lua-resty-ngxvar = 0.5.2",
     "lua-resty-jit-uuid = 0.0.7",
-    "lua-resty-healthcheck-api7 = 3.0.0",
+    "lua-resty-worker-events = 1.0.0",
+    "lua-resty-healthcheck-api7 = 3.2.0",
     "api7-lua-resty-jwt = 0.2.5",
     "lua-resty-hmac-ffi = 0.06-1",
     "lua-resty-cookie = 0.2.0-1",
diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec
index ec99128f3..d4e4b71a0 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -39,7 +39,8 @@ dependencies = {
     "lua-resty-balancer = 0.04",
     "lua-resty-ngxvar = 0.5.2",
     "lua-resty-jit-uuid = 0.0.7",
-    "lua-resty-healthcheck-api7 = 3.0.0",
+    "lua-resty-worker-events = 1.0.0",
+    "lua-resty-healthcheck-api7 = 3.2.0",
     "api7-lua-resty-jwt = 0.2.5",
     "lua-resty-hmac-ffi = 0.06-1",
     "lua-resty-cookie = 0.2.0-1",
diff --git a/t/control/healthcheck.t b/t/control/healthcheck.t
index 5d40e9707..9673ab917 100644
--- a/t/control/healthcheck.t
+++ b/t/control/healthcheck.t
@@ -51,7 +51,7 @@ routes:
 upstreams:
     - nodes:
         "127.0.0.1:1980": 1
-        "127.0.0.2:1988": 1
+        "127.0.0.2:1988": 0
       type: roundrobin
       id: 1
       checks:
@@ -120,11 +120,11 @@ upstreams:
 --- grep_error_log eval
 qr/unhealthy TCP increment \(.+\) for '[^']+'/
 --- grep_error_log_out
-unhealthy TCP increment (1/2) for '(127.0.0.2:1988)'
-unhealthy TCP increment (2/2) for '(127.0.0.2:1988)'
+unhealthy TCP increment (1/2) for '127.0.0.2(127.0.0.2:1988)'
+unhealthy TCP increment (2/2) for '127.0.0.2(127.0.0.2:1988)'
 --- response_body
-[{"counter":{"http_failure":0,"success":0,"tcp_failure":0,"timeout_failure":0},"ip":"127.0.0.1","port":1980,"status":"healthy"},{"counter":{"http_failure":0,"success":0,"tcp_failure":2,"timeout_failure":0},"ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
-[{"counter":{"http_failure":0,"success":0,"tcp_failure":0,"timeout_failure":0},"ip":"127.0.0.1","port":1980,"status":"healthy"},{"counter":{"http_failure":0,"success":0,"tcp_failure":2,"timeout_failure":0},"ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
+[{"counter":{"http_failure":0,"success":0,"tcp_failure":0,"timeout_failure":0},"hostname":"127.0.0.1","ip":"127.0.0.1","port":1980,"status":"healthy"},{"counter":{"http_failure":0,"success":0,"tcp_failure":2,"timeout_failure":0},"hostname":"127.0.0.2","ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
+[{"counter":{"http_failure":0,"success":0,"tcp_failure":0,"timeout_failure":0},"hostname":"127.0.0.1","ip":"127.0.0.1","port":1980,"status":"healthy"},{"counter":{"http_failure":0,"success":0,"tcp_failure":2,"timeout_failure":0},"hostname":"127.0.0.2","ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
 
 
 
diff --git a/t/discovery/consul.t b/t/discovery/consul.t
index 57a6ab5b4..ae1e10769 100644
--- a/t/discovery/consul.t
+++ b/t/discovery/consul.t
@@ -579,8 +579,8 @@ upstreams:
 --- request
 GET /thc
 --- response_body
-[{"ip":"127.0.0.1","port":30513,"status":"healthy"},{"ip":"127.0.0.1","port":30514,"status":"healthy"}]
-[{"ip":"127.0.0.1","port":30513,"status":"healthy"},{"ip":"127.0.0.1","port":30514,"status":"healthy"}]
+[{"hostname":"127.0.0.1","ip":"127.0.0.1","port":30513,"status":"healthy"},{"hostname":"127.0.0.1","ip":"127.0.0.1","port":30514,"status":"healthy"}]
+[{"hostname":"127.0.0.1","ip":"127.0.0.1","port":30513,"status":"healthy"},{"hostname":"127.0.0.1","ip":"127.0.0.1","port":30514,"status":"healthy"}]
 --- ignore_error_log
 
 
diff --git a/t/discovery/consul_kv.t b/t/discovery/consul_kv.t
index 9363f768d..072925cd1 100644
--- a/t/discovery/consul_kv.t
+++ b/t/discovery/consul_kv.t
@@ -450,8 +450,8 @@ upstreams:
 --- request
 GET /thc
 --- response_body
-[{"ip":"127.0.0.1","port":30511,"status":"healthy"},{"ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
-[{"ip":"127.0.0.1","port":30511,"status":"healthy"},{"ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
+[{"hostname":"127.0.0.1","ip":"127.0.0.1","port":30511,"status":"healthy"},{"hostname":"127.0.0.2","ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
+[{"hostname":"127.0.0.1","ip":"127.0.0.1","port":30511,"status":"healthy"},{"hostname":"127.0.0.2","ip":"127.0.0.2","port":1988,"status":"unhealthy"}]
 --- ignore_error_log
 
 
diff --git a/t/node/healthcheck-discovery.t b/t/node/healthcheck-discovery.t
index c8cf99b6c..e8e21b042 100644
--- a/t/node/healthcheck-discovery.t
+++ b/t/node/healthcheck-discovery.t
@@ -94,7 +94,7 @@ routes:
             local httpc = http.new()
             local res, err = httpc:request_uri(uri, {method = "GET", keepalive = false})
 
-            ngx.sleep(0.5)
+            ngx.sleep(1.5)
 
             ngx.say(res.status)
         }
diff --git a/t/node/healthcheck-leak-bugfix.t b/t/node/healthcheck-leak-bugfix.t
index d3ada8c17..1caf5d348 100644
--- a/t/node/healthcheck-leak-bugfix.t
+++ b/t/node/healthcheck-leak-bugfix.t
@@ -31,8 +31,8 @@ __DATA__
     local new = healthcheck.new
     healthcheck.new = function(...)
         local obj = new(...)
-        local clear = obj.clear
-        obj.clear = function(...)
+        local clear = obj.delayed_clear
+        obj.delayed_clear = function(...)
             ngx.log(ngx.WARN, "clear checker")
             return clear(...)
         end
diff --git a/t/node/healthcheck.t b/t/node/healthcheck.t
index 0ae4fbdb9..3053a0bb7 100644
--- a/t/node/healthcheck.t
+++ b/t/node/healthcheck.t
@@ -486,6 +486,7 @@ qr{\[error\].*while connecting to upstream.*}
 qr{.*http://127.0.0.1:1960/server_port.*
 .*http://127.0.0.1:1961/server_port.*
 .*http://127.0.0.1:1961/server_port.*
+.*http://127.0.0.1:1960/server_port.*
 .*http://127.0.0.1:1961/server_port.*
 .*http://127.0.0.1:1961/server_port.*}
 --- timeout: 10
diff --git a/t/node/priority-balancer/health-checker.t b/t/node/priority-balancer/health-checker.t
index fb65e3fd2..7ad685ac8 100644
--- a/t/node/priority-balancer/health-checker.t
+++ b/t/node/priority-balancer/health-checker.t
@@ -102,8 +102,8 @@ upstreams:
 GET /t
 --- error_log
 connect() failed
-unhealthy TCP increment (2/2) for '(127.0.0.1:1979)
-unhealthy TCP increment (2/2) for '(127.0.0.2:1979)
+unhealthy TCP increment (2/2) for '127.0.0.1(127.0.0.1:1979)
+unhealthy TCP increment (2/2) for '127.0.0.2(127.0.0.2:1979)
 --- grep_error_log eval
 qr/proxy request to \S+/
 --- grep_error_log_out
@@ -177,7 +177,7 @@ passed
 GET /t
 --- error_log
 connect() failed
-unhealthy TCP increment (2/2) for '(127.0.0.1:1979)
+unhealthy TCP increment (2/2) for '127.0.0.1(127.0.0.1:1979)
 --- grep_error_log eval
 qr/proxy request to \S+/
 --- grep_error_log_out