From f0fca7c68ad224a05fd82b478ca93ecc10bb7d06 Mon Sep 17 00:00:00 2001 From: chengyouling Date: Fri, 22 May 2026 20:07:04 +0800 Subject: [PATCH 1/2] [#5141] fixed latest instance information cannot be obtained when cache instances is empty problem. --- .../service/center/client/ServiceCenterDiscovery.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clients/service-center-client/src/main/java/org/apache/servicecomb/service/center/client/ServiceCenterDiscovery.java b/clients/service-center-client/src/main/java/org/apache/servicecomb/service/center/client/ServiceCenterDiscovery.java index 0056ed7a89..a1ab524c18 100644 --- a/clients/service-center-client/src/main/java/org/apache/servicecomb/service/center/client/ServiceCenterDiscovery.java +++ b/clients/service-center-client/src/main/java/org/apache/servicecomb/service/center/client/ServiceCenterDiscovery.java @@ -17,6 +17,7 @@ package org.apache.servicecomb.service.center.client; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -234,9 +235,15 @@ public void execute() { } private synchronized void pullAllInstance() { + List emptyInstancesCache = new ArrayList<>(); instancesCache.forEach((k, v) -> { pullInstance(k, v, true); + if (v.instancesCache.isEmpty()) { + emptyInstancesCache.add(k); + } }); + emptyInstancesCache.forEach(instancesCache::remove); + emptyInstancesCache.clear(); } private static String instanceToString(List instances) { From 8280b44ed073bc4a504589da83416420dbffbd72 Mon Sep 17 00:00:00 2001 From: chengyouling Date: Fri, 22 May 2026 20:12:04 +0800 Subject: [PATCH 2/2] update os version --- .github/workflows/checkstyle.yml | 2 +- .github/workflows/linelint.yml | 2 +- .github/workflows/maven.yml | 2 +- .github/workflows/rat_check.yml | 2 +- .github/workflows/typo_check.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index e5e7309b4e..3f97b9f181 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -26,7 +26,7 @@ on: jobs: checkstyle: timeout-minutes: 60 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 - name: Set up jdk diff --git a/.github/workflows/linelint.yml b/.github/workflows/linelint.yml index 49bafa7587..8d5112ea3d 100644 --- a/.github/workflows/linelint.yml +++ b/.github/workflows/linelint.yml @@ -26,7 +26,7 @@ on: jobs: linelint: timeout-minutes: 60 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 - name: install linelint diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0d2676fe76..24118c35c9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,7 +29,7 @@ jobs: build: timeout-minutes: 60 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/rat_check.yml b/.github/workflows/rat_check.yml index 4abcc94477..c2db2508fe 100644 --- a/.github/workflows/rat_check.yml +++ b/.github/workflows/rat_check.yml @@ -29,7 +29,7 @@ on: jobs: rat_check: timeout-minutes: 60 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 - name: Set up jdk diff --git a/.github/workflows/typo_check.yml b/.github/workflows/typo_check.yml index 745e63447d..999530a79f 100644 --- a/.github/workflows/typo_check.yml +++ b/.github/workflows/typo_check.yml @@ -26,7 +26,7 @@ on: jobs: typo-check: timeout-minutes: 60 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 # To run the typo check locally, you can follow these steps: