Oliverwqcwrw commented on code in PR #423:
URL: https://github.com/apache/rocketmq-connect/pull/423#discussion_r1099509810


##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/connectorwrapper/Worker.java:
##########
@@ -900,6 +910,21 @@ private void startTask(Map<String, List<ConnectKeyValue>> 
newTasks) throws Excep
         }
     }
 
+    private void redressRunningStatus(WorkerTask workerTask) {
+        TaskStatus taskStatus = stateManagementService.get(workerTask.id);
+        if (taskStatus != null && taskStatus.getState() != RUNNING && 
taskStatus.getState() != PAUSED) {
+            ConnectorStatus connectorStatus = 
stateManagementService.get(workerTask.id.connector());
+            TaskStatus newTaskStatus;
+            if (null != connectorStatus && connectorStatus.getState() == 
PAUSED) {
+                newTaskStatus = new TaskStatus(workerTask.id, PAUSED, 
workerConfig.getWorkerId(), System.currentTimeMillis());
+            } else {
+                newTaskStatus = new TaskStatus(workerTask.id, RUNNING, 
workerConfig.getWorkerId(), System.currentTimeMillis());

Review Comment:
   IMO, It is better to set the task status to running when the connector is in 
the running state. If the connector is failed, the task is also set to running 
at present



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to