Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

apollo-adminservice currently terminates immediately on shutdown, interrupting in-flight requests and potentially causing clients to hit already-stopped instances due to Eureka registration lag.

Changes

  • Configuration: Enabled Spring Boot's graceful shutdown in application.yml:

    server:
      shutdown: graceful
    spring:
      lifecycle:
        timeout-per-shutdown-phase: 30s
  • Test: Added GracefulShutdownConfigurationTest to verify lifecycle processor is configured

  • Documentation: Updated EN/CN deployment guides with graceful shutdown details and added CHANGES.md entry

Behavior

On SIGTERM, the service now:

  1. Stops accepting new requests
  2. Waits up to 30s for active requests to complete
  3. Allows Eureka deregistration to propagate before final shutdown

Timeout is configurable via spring.lifecycle.timeout-per-shutdown-phase.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • central.sonatype.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/apollo/apollo org.codehaus.plexus.classworlds.launcher.Launcher test -pl apollo-adminservice -Dtest=GracefulShutdownConfigurationTest -DfailIfNoTests=false (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/apollo/apollo org.codehaus.plexus.classworlds.launcher.Launcher clean install -DskipTests -T 1C (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/apollo/apollo org.codehaus.plexus.classworlds.launcher.Launcher clean package -DskipTests -pl apollo-adminservice -am -Dapollo_profile=github (dns block)
  • www.puppycrawl.com
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.23.9/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.23.9/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.9/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/apollo/.codeql-scratch/dbs/java/working/files-to-index14398284797094138224.list --sourceArchiveDir=/home/REDACTED/work/apollo/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/apollo/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>目前 apollo-adminservice 缺乏优雅下线机制,服务停止时可能中断正在处理的请求,造成请求失败。</issue_title>
<issue_description>目前 apollo-adminservice 未实现优雅下线特性,当服务节点被终止时,存在以下问题:正在处理中的请求会被强制中断,同时 Eureka 注册信息未能及时清除,可能导致其他服务继续向已下线节点发送请求,造成请求损失。</issue_description>

<agent_instructions>1. learn how to enable graceful shutdown in spring boot
2. see how to enable this feature in apollo and configure it in a reasonable way
3. add necessary tests to verify this feature is working as expected</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 24, 2026 01:39
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Copilot AI changed the title [WIP] Add graceful shutdown mechanism for apollo-adminservice Enable graceful shutdown for apollo-adminservice Jan 24, 2026
Copilot AI requested a review from nobodyiam January 24, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

目前 apollo-adminservice 缺乏优雅下线机制,服务停止时可能中断正在处理的请求,造成请求失败。

2 participants