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

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


The following commit(s) were added to refs/heads/master by this push:
     new f2523f7ad6 chore: bump APISIX-Runtime to 1.4.0 (#14041)
f2523f7ad6 is described below

commit f2523f7ad6e3cd3b4c17835b62626f5a39a1c31f
Author: Shreemaan Abhishek <[email protected]>
AuthorDate: Mon Oct 26 15:43:39 2026 +0800

    chore: bump APISIX-Runtime to 1.4.0 (#14041)
---
 .requirements                                 |  2 +-
 apisix/plugins/prometheus/process_metrics.lua | 41 ++++++++++++------
 ci/linux-install-openresty.sh                 |  6 +--
 t/core/runtime-version.t                      | 60 +++++++++++++++++++++++++++
 t/plugin/ocsp-stapling.t                      |  4 +-
 5 files changed, 94 insertions(+), 19 deletions(-)

diff --git a/.requirements b/.requirements
index a26f9999df..bd5f61e9df 100644
--- a/.requirements
+++ b/.requirements
@@ -17,5 +17,5 @@
 
 APISIX_PACKAGE_NAME=apisix
 
-APISIX_RUNTIME=1.3.19
+APISIX_RUNTIME=1.4.0
 APISIX_DASHBOARD_COMMIT=fa2fd0f60f8afffb096476333b9ba63b4c518fa3
diff --git a/apisix/plugins/prometheus/process_metrics.lua 
b/apisix/plugins/prometheus/process_metrics.lua
index ff4ddfb4c3..4861cc50ca 100644
--- a/apisix/plugins/prometheus/process_metrics.lua
+++ b/apisix/plugins/prometheus/process_metrics.lua
@@ -35,11 +35,20 @@ local pairs         = pairs
 local select        = select
 
 
--- The prefix of struct ngx_cycle_s up to write_events. Its layout is the same
--- in every nginx core shipped by the supported runtimes (1.21.4 to 1.29.x);
--- the self check in check_cycle_layout() is what keeps a future change from
--- turning into a wrong number.
-ffi.cdef[[
+-- nginx 1.29.7 appends spare slots to ngx_log_t in --with-compat builds
+local log_spare = ""
+if ngx.config.nginx_version >= 1029007
+   and ngx.config.nginx_configure():find("--with-compat", 1, true)
+then
+    log_spare = "uint64_t spare[5];"
+end
+
+
+-- The prefix of struct ngx_cycle_s up to write_events, as laid out by the
+-- supported runtimes (nginx 1.21.4 to 1.31.x); the self check in
+-- check_cycle_layout() is what keeps a future change from turning into a
+-- wrong number.
+ffi.cdef([[
 typedef struct {
     uintptr_t       log_level;
     void           *file;
@@ -51,6 +60,7 @@ typedef struct {
     void           *wdata;
     char           *action;
     void           *next;
+    ]] .. log_spare .. [[
 } apisix_prom_ngx_log_t;
 
 typedef struct {
@@ -126,7 +136,7 @@ typedef struct {
 } apisix_prom_ngx_cycle_t;
 
 extern apisix_prom_ngx_cycle_t *ngx_cycle;
-]]
+]])
 
 
 -- nginx's own defaults for lua_max_running_timers / lua_max_pending_timers,
@@ -186,13 +196,7 @@ local function read_cycle()
     local cycle = C.ngx_cycle
     local connection_n = tonumber(cycle.connection_n)
     local free_n = tonumber(cycle.free_connection_n)
-
-    -- every connection slot is wired to its own pair of events at startup, so
-    -- this pins down the offsets right after connection_n as well
-    local conns = cycle.connections
-    if connection_n == 0 or free_n > connection_n or conns == nil
-       or conns[0].read ~= cycle.read_events or conns[0].write ~= 
cycle.write_events
-    then
+    if connection_n == 0 or free_n > connection_n then
         return nil
     end
 
@@ -213,6 +217,17 @@ local function check_cycle_layout()
                       .. ", but worker_connections is " .. tostring(expected)
     end
 
+    -- every connection slot is wired to its own pair of events at startup, so
+    -- this pins down the offsets right after connection_n as well. Only follow
+    -- the pointer once connection_n matched: a bad one crashes the worker.
+    local cycle = C.ngx_cycle
+    local conns = cycle.connections
+    if conns == nil
+       or conns[0].read ~= cycle.read_events or conns[0].write ~= 
cycle.write_events
+    then
+        return false, "unexpected nginx cycle layout"
+    end
+
     return true
 end
 
diff --git a/ci/linux-install-openresty.sh b/ci/linux-install-openresty.sh
index 51bdf0fae7..a2e09ec988 100755
--- a/ci/linux-install-openresty.sh
+++ b/ci/linux-install-openresty.sh
@@ -61,7 +61,7 @@ else
     sudo apt-get -y update --fix-missing
     sudo apt-get install -y build-essential gcc g++ cpanminus libxml2-dev 
libxslt-dev
 
-    if [ "$APISIX_RUNTIME" != "1.3.19" ]; then
+    if [ "$APISIX_RUNTIME" != "1.4.0" ]; then
         echo "Please update the apisix-runtime-debug checksum for 
APISIX_RUNTIME=$APISIX_RUNTIME" >&2
         exit 1
     fi
@@ -69,11 +69,11 @@ else
     case "$ARCH" in
         x86_64|amd64)
             DEB_ARCH="amd64"
-            
EXPECTED_SHA256="0f350a142c915a70d4501d68259a1506ffdd8efd6a1464802c8935b1f36fdf3b"
+            
EXPECTED_SHA256="09d979543e65d6b16994d754f55ea759fe558fbb824fa8aed2ecd72a139b91b4"
             ;;
         arm64|aarch64)
             DEB_ARCH="arm64"
-            
EXPECTED_SHA256="67fc887818f2899874e26fc539b9f49c78c7f8e73aed495683df9b694250db54"
+            
EXPECTED_SHA256="d5803bd4c793332f0412968a85407a498de3b85c372edb65fcd0019aaaf05990"
             ;;
         *)
             echo "Unsupported architecture: $ARCH" >&2
diff --git a/t/core/runtime-version.t b/t/core/runtime-version.t
new file mode 100644
index 0000000000..475b553374
--- /dev/null
+++ b/t/core/runtime-version.t
@@ -0,0 +1,60 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+use t::APISIX 'no_plan';
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+
+run_tests();
+
+__DATA__
+
+=== TEST 1: nginx is 1.31.1 or newer
+--- config
+    location /t {
+        content_by_lua_block {
+            if ngx.config.nginx_version >= 1031001 then
+                ngx.say("OK")
+            else
+                ngx.say("BAD: nginx ", ngx.config.nginx_version)
+            end
+        }
+    }
+--- request
+GET /t
+--- response_body
+OK
+
+
+
+=== TEST 2: OpenSSL is 3.5.9 or newer
+--- config
+    location /t {
+        content_by_lua_block {
+            local version = require("resty.openssl.version")
+            if version.version_num >= 0x30500090 then
+                ngx.say("OK")
+            else
+                ngx.say("BAD: ", version.version_text)
+            end
+        }
+    }
+--- request
+GET /t
+--- response_body
+OK
diff --git a/t/plugin/ocsp-stapling.t b/t/plugin/ocsp-stapling.t
index 1d32c02f19..5cd6acaa95 100644
--- a/t/plugin/ocsp-stapling.t
+++ b/t/plugin/ocsp-stapling.t
@@ -407,7 +407,7 @@ qr/CONNECTED/
 echo -n "Q" | $OPENSSL_BIN s_client -connect localhost:1994 -servername 
ocsp.test.com -status -tls1_2 -cipher ECDHE-ECDSA-AES128-GCM-SHA256 2>&1 | cat
 --- max_size: 16096
 --- response_body eval
-qr/Peer signature type: ECDSA/
+qr/Peer signature type: (?i:ecdsa)/
 
 
 
@@ -434,7 +434,7 @@ qr/CONNECTED/
 echo -n "Q" | $OPENSSL_BIN s_client -connect localhost:1994 -servername 
ocsp.test.com -status -tls1_2 -cipher ECDHE-RSA-AES128-GCM-SHA256 2>&1 | cat
 --- max_size: 16096
 --- response_body eval
-qr/Peer signature type: RSA/
+qr/Peer signature type: (?i:rsa)/
 
 
 

Reply via email to