From 7be91f25990a5d8f18644224358c3083327fc126 Mon Sep 17 00:00:00 2001 From: imbajin Date: Mon, 11 Dec 2023 10:28:33 +0800 Subject: [PATCH] tiny fix --- checkstyle.xml | 3 ++- .../hugegraph/computer/core/master/MasterService.java | 2 +- .../hugegraph/computer/core/worker/WorkerService.java | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index c0b084e95..ef00578cb 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -35,7 +35,8 @@ - + + diff --git a/computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java b/computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java index 51f58ebfa..da01fa7b2 100644 --- a/computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java +++ b/computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java @@ -156,7 +156,7 @@ public synchronized void close() { this.masterComputation.close(new DefaultMasterContext()); } } catch (Exception e) { - LOG.error("Error occurred while closing masterComputation", e); + LOG.error("Error occurred while closing master service", e); } if (!failed && this.bsp4Master != null) { diff --git a/computer-core/src/main/java/org/apache/hugegraph/computer/core/worker/WorkerService.java b/computer-core/src/main/java/org/apache/hugegraph/computer/core/worker/WorkerService.java index b8839c179..8d776b327 100644 --- a/computer-core/src/main/java/org/apache/hugegraph/computer/core/worker/WorkerService.java +++ b/computer-core/src/main/java/org/apache/hugegraph/computer/core/worker/WorkerService.java @@ -172,9 +172,14 @@ public synchronized void close() { } try { - this.computeManager.close(); + if (this.computeManager != null) { + this.computeManager.close(); + } else { + LOG.warn("The computeManager is null"); + return; + } } catch (Exception e) { - LOG.error("Error when closing computeManager", e); + LOG.error("Error when closing ComputeManager", e); } /* * Seems managers.closeAll() would do the following actions: