You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/02/27 15:40:29 UTC

(shardingsphere) branch master updated: Fix resource leak in StatisticsCollectJobWorker - close CoordinatorRegistryCenter on destroy (#38244)

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

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c5c93622e1 Fix resource leak in StatisticsCollectJobWorker - close CoordinatorRegistryCenter on destroy (#38244)
4c5c93622e1 is described below

commit 4c5c93622e147ff87541bd84ee313d6d4aef6430
Author: ZIHAN DAI <99...@users.noreply.github.com>
AuthorDate: Sat Feb 28 02:40:22 2026 +1100

    Fix resource leak in StatisticsCollectJobWorker - close CoordinatorRegistryCenter on destroy (#38244)
    
    Fixes #38242
---
 .../core/job/statistics/collect/StatisticsCollectJobWorker.java        | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobWorker.java b/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobWorker.java
index c7f73ad68a5..c781e1630b0 100644
--- a/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobWorker.java
+++ b/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobWorker.java
@@ -141,6 +141,9 @@ public final class StatisticsCollectJobWorker {
         if (WORKER_INITIALIZED.compareAndSet(true, false)) {
             Optional.ofNullable(scheduleJobBootstrap).ifPresent(ScheduleJobBootstrap::shutdown);
             scheduleJobBootstrap = null;
+            Optional.ofNullable(registryCenter).ifPresent(CoordinatorRegistryCenter::close);
+            registryCenter = null;
+            contextManager = null;
         }
     }
 }