Skip to content

Commit ea6db48

Browse files
spacewanderyzhhzyjack.fuleslie-tsangtzssangglass
authored
feat: release 2.10.1 (#5310)
Co-authored-by: 罗泽轩 <[email protected]> Co-authored-by: zdzh <[email protected]> Co-authored-by: jack.fu <[email protected]> Co-authored-by: leslie <[email protected]> Co-authored-by: tzssangglass <[email protected]> Co-authored-by: oliver <[email protected]> Co-authored-by: zdzh <[email protected]> Co-authored-by: jackfu <[email protected]>
1 parent 6cab3b6 commit ea6db48

File tree

20 files changed

+416
-32
lines changed

20 files changed

+416
-32
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ title: Changelog
2323

2424
## Table of Contents
2525

26+
- [2.10.1](#2101)
2627
- [2.10.0](#2100)
2728
- [2.9.0](#290)
2829
- [2.8.0](#280)
@@ -46,6 +47,18 @@ title: Changelog
4647
- [0.7.0](#070)
4748
- [0.6.0](#060)
4849

50+
## 2.10.1
51+
52+
### Bugfix
53+
54+
- fix(zipkin): response_span doesn't have correct start time [#5295](https://github.com/apache/apisix/pull/5295)
55+
- fix(ext-plugin): don't use stale key [#5309](https://github.com/apache/apisix/pull/5309)
56+
- fix: route's timeout should not be overwrittern by service [#5219](https://github.com/apache/apisix/pull/5219)
57+
- fix: filter nil plugin conf triggered by etcd dir init [#5204](https://github.com/apache/apisix/pull/5204)
58+
- fix: pass correct host header to health checker target nodes [#5175](https://github.com/apache/apisix/pull/5175)
59+
- fix: upgrade lua-resty-balancer to 0.04 [#5144](https://github.com/apache/apisix/pull/5144)
60+
- fix(prometheus): avoid negative latency caused by inconsistent Nginx metrics [#5150](https://github.com/apache/apisix/pull/5150)
61+
4962
## 2.10.0
5063

5164
### Change

apisix/core/version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
-- limitations under the License.
1616
--
1717
return {
18-
VERSION = "2.10.0"
18+
VERSION = "2.10.1"
1919
}

apisix/plugin.lua

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,14 @@ function _M.load(config)
244244
http_plugin_names = {}
245245
stream_plugin_names = {}
246246
local plugins_conf = config.value
247-
for _, conf in ipairs(plugins_conf) do
248-
if conf.stream then
249-
core.table.insert(stream_plugin_names, conf.name)
250-
else
251-
core.table.insert(http_plugin_names, conf.name)
247+
-- plugins_conf can be nil when another instance writes into etcd key "/apisix/plugins/"
248+
if plugins_conf then
249+
for _, conf in ipairs(plugins_conf) do
250+
if conf.stream then
251+
core.table.insert(stream_plugin_names, conf.name)
252+
else
253+
core.table.insert(http_plugin_names, conf.name)
254+
end
252255
end
253256
end
254257
end
@@ -409,6 +412,10 @@ local function merge_service_route(service_conf, route_conf)
409412
new_conf.value.script = route_conf.value.script
410413
end
411414

415+
if route_conf.value.timeout then
416+
new_conf.value.timeout = route_conf.value.timeout
417+
end
418+
412419
if route_conf.value.name then
413420
new_conf.value.name = route_conf.value.name
414421
else

apisix/plugins/ext-plugin/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ local type = type
6565
local events_list
6666
local lrucache = core.lrucache.new({
6767
type = "plugin",
68+
invalid_stale = true,
6869
ttl = helper.get_conf_token_cache_time(),
6970
})
7071

apisix/plugins/prometheus/exporter.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ function _M.log(conf, ctx)
153153
metrics.latency:observe(upstream_latency,
154154
gen_arr("upstream", route_id, service_id, consumer_name, balancer_ip))
155155
apisix_latency = apisix_latency - upstream_latency
156+
157+
-- The latency might be negative, as Nginx uses different time measurements in
158+
-- different metrics.
159+
-- See https://github.com/apache/apisix/issues/5146#issuecomment-928919399
160+
if apisix_latency < 0 then
161+
apisix_latency = 0
162+
end
163+
156164
end
157165
metrics.latency:observe(apisix_latency,
158166
gen_arr("apisix", route_id, service_id, consumer_name, balancer_ip))
@@ -165,9 +173,10 @@ function _M.log(conf, ctx)
165173
end
166174

167175

168-
local ngx_status_items = {"active", "accepted", "handled", "total",
169-
"reading", "writing", "waiting"}
170-
local label_values = {}
176+
local ngx_status_items = {"active", "accepted", "handled", "total",
177+
"reading", "writing", "waiting"}
178+
local label_values = {}
179+
171180
local function nginx_status()
172181
local res = ngx_capture("/apisix/nginx_status")
173182
if not res or res.status ~= 200 then

apisix/plugins/zipkin.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,14 @@ function _M.header_filter(conf, ctx)
240240
local end_time = opentracing.tracer:time()
241241

242242
if conf.span_version == ZIPKIN_SPAN_VER_1 then
243-
ctx.HEADER_FILTER_END_TIME = end_time
244243
if opentracing.proxy_span then
245244
opentracing.body_filter_span = opentracing.proxy_span:start_child_span(
246-
"apisix.body_filter", ctx.HEADER_FILTER_END_TIME)
245+
"apisix.body_filter", end_time)
247246
end
248247
else
249248
opentracing.proxy_span:finish(end_time)
250249
opentracing.response_span = opentracing.request_span:start_child_span(
251-
"apisix.response_span", ctx.HEADER_FILTER_END_TIME)
250+
"apisix.response_span", end_time)
252251
end
253252
end
254253

apisix/upstream.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ local function create_checker(upstream)
111111

112112
local host = upstream.checks and upstream.checks.active and upstream.checks.active.host
113113
local port = upstream.checks and upstream.checks.active and upstream.checks.active.port
114+
local up_hdr = upstream.pass_host == "rewrite" and upstream.upstream_host
115+
local use_node_hdr = upstream.pass_host == "node"
114116
for _, node in ipairs(upstream.nodes) do
115-
local ok, err = checker:add_target(node.host, port or node.port, host)
117+
local host_hdr = up_hdr or (use_node_hdr and node.domain)
118+
local ok, err = checker:add_target(node.host, port or node.port, host,
119+
true, host_hdr)
116120
if not ok then
117121
core.log.error("failed to add new health check target: ", node.host, ":",
118122
port or node.port, " err: ", err)

docs/en/latest/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.10.0",
2+
"version": "2.10.1",
33
"sidebar": [
44
{
55
"type": "category",

docs/en/latest/how-to-build.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can install Apache APISIX via RPM package, Docker, Helm Chart, and source re
3636
This installation method is suitable for CentOS 7, please run the following command to install Apache APISIX.
3737

3838
```shell
39-
sudo yum install -y https://github.com/apache/apisix/releases/download/2.10.0/apisix-2.10.0-0.el7.x86_64.rpm
39+
sudo yum install -y https://github.com/apache/apisix/releases/download/2.10.1/apisix-2.10.1-0.el7.x86_64.rpm
4040
```
4141

4242
### Installation via Docker
@@ -49,31 +49,31 @@ Please refer to: [Installing Apache APISIX with Helm Chart](https://github.com/a
4949

5050
### Installation via Source Release Package
5151

52-
1. Create a directory named `apisix-2.10.0`.
52+
1. Create a directory named `apisix-2.10.1`.
5353

5454
```shell
55-
mkdir apisix-2.10.0
55+
mkdir apisix-2.10.1
5656
```
5757

5858
2. Download Apache APISIX Release source package.
5959

6060
```shell
61-
wget https://downloads.apache.org/apisix/2.10.0/apache-apisix-2.10.0-src.tgz
61+
wget https://downloads.apache.org/apisix/2.10.1/apache-apisix-2.10.1-src.tgz
6262
```
6363

6464
You can also download the Apache APISIX Release source package from the Apache APISIX website. The [Apache APISIX Official Website - Download Page](https://apisix.apache.org/downloads/) also provides source packages for Apache APISIX, APISIX Dashboard and APISIX Ingress Controller.
6565

6666
3. Unzip the Apache APISIX Release source package.
6767

6868
```shell
69-
tar zxvf apache-apisix-2.10.0-src.tgz -C apisix-2.10.0
69+
tar zxvf apache-apisix-2.10.1-src.tgz -C apisix-2.10.1
7070
```
7171

7272
4. Install the runtime dependent Lua libraries.
7373

7474
```shell
75-
# Switch to the apisix-2.10.0 directory
76-
cd apisix-2.10.0
75+
# Switch to the apisix-2.10.1 directory
76+
cd apisix-2.10.1
7777
# Create dependencies
7878
make deps
7979
```

docs/zh/latest/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ title: CHANGELOG
2323

2424
## Table of Contents
2525

26+
- [2.10.1](#2101)
2627
- [2.10.0](#2100)
2728
- [2.9.0](#290)
2829
- [2.8.0](#280)
@@ -46,6 +47,18 @@ title: CHANGELOG
4647
- [0.7.0](#070)
4748
- [0.6.0](#060)
4849

50+
## 2.10.1
51+
52+
### Bugfix
53+
54+
- 更正 zipkin 插件 response_span 的开始时间 [#5295](https://github.com/apache/apisix/pull/5295)
55+
- 避免发送过期 key 给 plugin runner [#5309](https://github.com/apache/apisix/pull/5309)
56+
- 更正 route 的 timeout 被 service 覆盖的问题 [#5219](https://github.com/apache/apisix/pull/5219)
57+
- 过滤掉初始化 etcd 数据时产生的空 plugin conf [#5204](https://github.com/apache/apisix/pull/5204)
58+
- 健康检查特定情况下会发送错误的 Host header [#5175](https://github.com/apache/apisix/pull/5175)
59+
- 升级 lua-resty-balancer 到 0.04 [#5144](https://github.com/apache/apisix/pull/5144)
60+
- prometheus 插件修复偶发的 latency 为负数的问题 [#5150](https://github.com/apache/apisix/pull/5150)
61+
4962
## 2.10.0
5063

5164
### Change

0 commit comments

Comments
 (0)