private void traverseManagerTasksToStore(Map<String, TaskProfile> tasksFromManager) {
        tasksFromManager.values().forEach((profileFromManager) -> {
            TaskProfile taskFromStore = taskStore.getTask(profileFromManager.getTaskId());
            if (taskFromStore == null) {
                LOGGER.info("traverseManagerTasksToStore task {} not found in task store retry {} state {}, add it",
                        profileFromManager.getTaskId(),
                        profileFromManager.isRetry(), profileFromManager.getState());
                addTask(profileFromManager);
                EventReportUtils.report(profileFromManager.getInlongGroupId(),
                        profileFromManager.getInlongStreamId(), AgentUtils.getCurrentTime(),
                        EventReportUtils.EVENT_TYPE_CONFIG_UPDATE, EventReportUtils.EVENT_LEVEL_INFO,
                        EvenCodeEnum.TASK_ADD, profileFromManager.toJsonStr(),
                        EvenCodeEnum.TASK_ADD.getMessage());
            } else {
                TaskStateEnum managerState = profileFromManager.getState();
                TaskStateEnum storeState = taskFromStore.getState();
                if (managerState == storeState) {
                    return;
                }
                if (storeState == TaskStateEnum.RETRY_FINISH) {
                    LOGGER.info("traverseManagerTasksToStore task {} storeState {} retry {}, do nothing",
                            taskFromStore.getTaskId(), storeState,
                            taskFromStore.isRetry());
                    return;
                }
                if (managerState == TaskStateEnum.RUNNING) {
                    LOGGER.info("traverseManagerTasksToStore task {} storeState {} retry {}, active it",
                            taskFromStore.getTaskId(), storeState, taskFromStore.isRetry());
                    activeTask(profileFromManager);
                } else {
                    LOGGER.info("traverseManagerTasksToStore task {} storeState {} retry {}, freeze it",
                            taskFromStore.getTaskId(), storeState, taskFromStore.isRetry());
                    freezeTask(profileFromManager);
                }
            }
        });
    }
keep pace with task in task store
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java