Skip to content

Commit ddddbae

Browse files
authored
Fix NPE in Procedure's log (apache#16255)
1 parent 4937c45 commit ddddbae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,17 +803,18 @@ private int calculateRunningAndStuckWorkers() {
803803
// Check if any of the worker is stuck
804804
int runningCount = 0, stuckCount = 0;
805805
for (WorkerThread worker : workerThreads) {
806-
if (worker.activeProcedure.get() == null) {
806+
final Procedure<?> proc = worker.activeProcedure.get();
807+
if (proc == null) {
807808
continue;
808809
}
809810
runningCount++;
810811
// WARN the worker is stuck
811-
if (worker.getCurrentRunTime() < DEFAULT_WORKER_STUCK_THRESHOLD) {
812+
if (worker.getCurrentRunTime() > DEFAULT_WORKER_STUCK_THRESHOLD) {
812813
stuckCount++;
813814
LOG.warn(
814815
"Worker stuck {}({}), run time {} ms",
815816
worker,
816-
worker.activeProcedure.get().getProcType(),
817+
proc.getProcType(),
817818
worker.getCurrentRunTime());
818819
}
819820
LOG.info(

0 commit comments

Comments
 (0)