private void traverseStoreTasksToMemory() {
        taskStore.getTasks().forEach((profileFromStore) -> {
            TaskStateEnum storeState = profileFromStore.getState();
            Task task = taskMap.get(profileFromStore.getTaskId());
            if (storeState == TaskStateEnum.RUNNING) {
                if (task == null) {
                    LOGGER.info("traverseStoreTasksToMemory add task to mem taskId {}", profileFromStore.getTaskId());
                    addToMemory(profileFromStore);
                }
            } else if (storeState == TaskStateEnum.FROZEN) {
                if (task != null) {
                    LOGGER.info("traverseStoreTasksToMemory delete task from mem taskId {}",
                            profileFromStore.getTaskId());
                    deleteFromMemory(profileFromStore.getTaskId());
                }
            } else {
                if (storeState != TaskStateEnum.RETRY_FINISH) {
                    LOGGER.error("task {} invalid state {}", profileFromStore.getTaskId(), storeState);
                }
            }
        });
    }
manager task state is RUNNING and taskMap not found then add
manager task state is FROZE and taskMap found thrn delete
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java