Explorar o código

fix dead loop in StateEventResponseWorker (#6281)

Wenjun Ruan %!s(int64=3) %!d(string=hai) anos
pai
achega
ebb56b2620

+ 1 - 1
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);
     }
 

+ 2 - 1
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);
         }
     }