From ebb56b2620b7fb3c7dba70ba9342bddc909a2e75 Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Sun, 26 Sep 2021 11:57:37 +0800 Subject: [PATCH] fix dead loop in StateEventResponseWorker (#6281) --- .../server/master/processor/StateEventProcessor.java | 2 +- .../master/processor/queue/StateEventResponseService.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java index 824bff2f90..d5a8e85b5d 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java @@ -68,7 +68,7 @@ public class StateEventProcessor implements NettyRequestProcessor { StateEventType type = stateEvent.getTaskInstanceId() == 0 ? StateEventType.PROCESS_STATE_CHANGE : StateEventType.TASK_STATE_CHANGE; stateEvent.setType(type); - logger.info("received command : {}", stateEvent.toString()); + logger.info("received command : {}", stateEvent); stateEventResponseService.addResponse(stateEvent); } diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/queue/StateEventResponseService.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/queue/StateEventResponseService.java index f894fc340f..bc9c77cfaf 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/queue/StateEventResponseService.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/queue/StateEventResponseService.java @@ -114,6 +114,7 @@ public class StateEventResponseService { } catch (InterruptedException e) { logger.warn("persist task error", e); Thread.currentThread().interrupt(); + break; } } logger.info("StateEventResponseWorker stopped"); @@ -139,7 +140,7 @@ public class StateEventResponseService { workflowExecuteThread.addStateEvent(stateEvent); writeResponse(stateEvent, ExecutionStatus.SUCCESS); } catch (Exception e) { - logger.error("persist event queue error:", stateEvent.toString(), e); + logger.error("persist event queue error, event: {}", stateEvent, e); } }