From acab52e9a96333a9adf16ee88dba7d6397d52224 Mon Sep 17 00:00:00 2001 From: hengsin Date: Thu, 8 Jun 2023 03:28:32 +0800 Subject: [PATCH] IDEMPIERE-5763 Improve reliability of stopping a scheduler (#1885) --- .../compiere/server/AdempiereServerMgr.java | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java index 644e1ab0b5..e0f777e0f5 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java @@ -25,6 +25,7 @@ import java.util.Properties; import java.util.Set; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import org.adempiere.base.Core; @@ -467,10 +468,7 @@ public class AdempiereServerMgr implements ServiceTrackerCustomizer scheduleFuture; + protected AtomicBoolean stop; private LocalServerController(AdempiereServer server) { this(server, true); @@ -743,22 +745,47 @@ public class AdempiereServerMgr implements ServiceTrackerCustomizer