From 86ce76a45c99c2d6af1faff05d3c6fe24372df2b Mon Sep 17 00:00:00 2001 From: Davidhua1996 Date: Mon, 18 Nov 2024 19:03:09 +0800 Subject: [PATCH] Fix the problem that not released of parallel resources. --- .../execution/subscriber/NewInTaskObserver.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java index c919306d7..8454d85e5 100644 --- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/execution/subscriber/NewInTaskObserver.java @@ -75,9 +75,15 @@ public int subscribe(List publishedTasks) throws Exchan if (parallelRule.incParallel()) { // check the status of launchedTask // insert or update launched task, status as TaskStatus.Scheduler - boolean success = observerService.subscribe(launchableExchangisTask); - if (!success){ - parallelRule.decParallel(1); + boolean success = false; + try { + success = observerService.subscribe(launchableExchangisTask); + } catch (Exception e){ + throw e; + } finally { + if (!success){ + parallelRule.decParallel(1); + } } return success; }