This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 74c77a1 [#359] 补充K8S脚本启动无法使用优雅停机说明 (#360)
74c77a1 is described below
commit 74c77a1b92780f41a1d31c2c1aa8aec7ea3b3f27
Author: Alex <[email protected]>
AuthorDate: Wed Aug 6 08:49:11 2025 +0800
[#359] 补充K8S脚本启动无法使用优雅停机说明 (#360)
---
java-chassis-reference/en_US/docs/general-development/shutdown.md | 7 +++++++
java-chassis-reference/zh_CN/docs/general-development/shutdown.md | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/java-chassis-reference/en_US/docs/general-development/shutdown.md
b/java-chassis-reference/en_US/docs/general-development/shutdown.md
index 36e32c7..9a8feae 100644
--- a/java-chassis-reference/en_US/docs/general-development/shutdown.md
+++ b/java-chassis-reference/en_US/docs/general-development/shutdown.md
@@ -10,6 +10,13 @@ Graceful shutdown can solve the following scenes:
Graceful shutdown can't solve the following scenes:
* KILL -9 PID or taskkill /f /pid
+## Special Scenes
+
+* In the K8S scenario, it failed to trigger graceful shutdown when using
start.sh script starting the service.
+ 1.script content: java -jar xxx
+ 2.reason: After the container starts, the main process is not a Java process
but the start.sh script. When K8S stops the pod, it only sends a termination
signal to the main process. As a result, the Java process cannot receive the
termination signal, making it impossible to perform a graceful shutdown.
+
+
## Effect
When triggering graceful shutdown:
* Provider:
diff --git a/java-chassis-reference/zh_CN/docs/general-development/shutdown.md
b/java-chassis-reference/zh_CN/docs/general-development/shutdown.md
index 7219ff7..a524aaa 100644
--- a/java-chassis-reference/zh_CN/docs/general-development/shutdown.md
+++ b/java-chassis-reference/zh_CN/docs/general-development/shutdown.md
@@ -10,6 +10,12 @@ ServiceComb是通过JDK的ShutdownHook来完成优雅停机的。
优雅停机解决不了以下场景:
* KILL -9 PID 或 taskkill /f /pid
+## 特殊场景
+
+* K8S场景中使用start.sh脚本启动服务时无法触发优雅停机。
+ 脚本内容:java -jar xxx
+
原因:因为容器启动后,主进程不是java进程,而是start.sh脚本,而K8S停止pod时,只会向主进程发送终止信号,进而java进程无法收到终止信号,所以无法进行优雅停机。
+
## 效果
触发优雅停机时:
* 服务提供者: