This is an automated email from the ASF dual-hosted git repository.
nic443 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 1af6ec4f8 fix: load full data during init_worker phase require a new
apisix-runtime (#12678)
1af6ec4f8 is described below
commit 1af6ec4f81edbf3723c2c60c432b5b0b449fd86f
Author: Nic <[email protected]>
AuthorDate: Thu Oct 16 17:28:16 2025 +0800
fix: load full data during init_worker phase require a new apisix-runtime
(#12678)
Signed-off-by: Nic <[email protected]>
---
.requirements | 2 +-
t/cli/test_ci_only.sh | 2 +-
t/cli/test_load_full_data_init_worker.sh | 52 +++++++++++++++++++++++++++++---
3 files changed, 49 insertions(+), 7 deletions(-)
diff --git a/.requirements b/.requirements
index 9e96f5679..f5bafe315 100644
--- a/.requirements
+++ b/.requirements
@@ -17,5 +17,5 @@
APISIX_PACKAGE_NAME=apisix
-APISIX_RUNTIME=1.3.2
+APISIX_RUNTIME=1.3.3
APISIX_DASHBOARD_COMMIT=39be363cdbc5395d3163572c532be95f3dbad03a
diff --git a/t/cli/test_ci_only.sh b/t/cli/test_ci_only.sh
index d7d9f5bd1..30e73b208 100755
--- a/t/cli/test_ci_only.sh
+++ b/t/cli/test_ci_only.sh
@@ -49,7 +49,7 @@ git checkout conf/config.yaml
mkdir /root/apisix
-cp -r ./* /root/apisix
+cp -R ./* /root/apisix
cd /root/apisix
make init
diff --git a/t/cli/test_load_full_data_init_worker.sh
b/t/cli/test_load_full_data_init_worker.sh
index 35e7fe2ab..5c4599623 100755
--- a/t/cli/test_load_full_data_init_worker.sh
+++ b/t/cli/test_load_full_data_init_worker.sh
@@ -19,25 +19,56 @@
. ./t/cli/common.sh
+rm logs/error.log || true
+
git checkout conf/config.yaml
echo '
apisix:
worker_startup_time_threshold: 3
+nginx_config:
+ worker_processes: 1
+ http_configuration_snippet: |
+ server {
+ listen 1980;
+ location /hello {
+ return 200 "hello world";
+ }
+ }
' > conf/config.yaml
make run
sleep 5
+admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed
's/"//g')
+curl -k -i http://127.0.0.1:9180/apisix/admin/routes/1 -H "X-API-KEY:
$admin_key" -X PUT -d '
+{
+ "uri": "/hello",
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1980": 1
+ },
+ "scheme": "http",
+ "type": "roundrobin"
+ }
+}'
+
+sleep 1
+
+code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9080/hello)
+if [ ! $code -eq 200 ]; then
+ echo "failed: request failed, http status $code"
+ exit 1
+fi
+
MASTER_PID=$(cat logs/nginx.pid)
-worker_pids=$(pgrep -P "$MASTER_PID" -f "nginx: worker process" || true)
+worker_pid=$(pgrep -P "$MASTER_PID" -f "nginx: worker process" || true)
-if [ -n "$worker_pids" ]; then
- pid=$(echo "$worker_pids" | shuf -n 1)
- echo "killing worker $pid (master $MASTER_PID)"
- kill "$pid"
+if [ -n "$worker_pid" ]; then
+ echo "killing worker $worker_pid (master $MASTER_PID)"
+ kill "$worker_pid"
else
echo "failed: no worker process found for master $MASTER_PID"
exit 1
@@ -50,6 +81,17 @@ if ! grep 'master process has been running for a long time,
reloading the full c
exit 1
fi
+if grep 'API disabled in the context of init_worker_by_lua' logs/error.log;
then
+ echo "failed: cannot access etcd in init_worker phase"
+ exit 1
+fi
+
+code=$(curl -v -k -i -m 20 -o /dev/null -s -w %{http_code}
http://127.0.0.1:9080/hello)
+if [ ! $code -eq 200 ]; then
+ echo "failed: request failed for new worker, http status $code"
+ exit 1
+fi
+
echo "passed: load full configuration for new worker"
make stop