justinwwhuang commented on code in PR #11775: URL: https://github.com/apache/inlong/pull/11775#discussion_r1967239984
########## inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java: ########## @@ -61,13 +61,13 @@ public class TaskManager extends AbstractDaemon { private static final int ACTION_QUEUE_CAPACITY = 1000; private long lastPrintTime = 0; // task basic store - private final Store taskBasicStore; + private static Store taskBasicStore; Review Comment: Only in AgentManager will a TaskManager object be created public AgentManager() { conf = AgentConfiguration.getAgentConf(); agentConfMonitor = Executors.newSingleThreadExecutor(); taskManager = new TaskManager(); ########## inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java: ########## @@ -61,13 +61,13 @@ public class TaskManager extends AbstractDaemon { private static final int ACTION_QUEUE_CAPACITY = 1000; private long lastPrintTime = 0; // task basic store - private final Store taskBasicStore; + private static Store taskBasicStore; Review Comment: > Since TaskManager is not a singleton, the static taskStore might be recreated multiple times. > > ``` > public TaskManager() { > taskBasicStore = initStore( > agentConf.get(AgentConstants.AGENT_ROCKS_DB_PATH, AgentConstants.AGENT_STORE_PATH_TASK)); > taskStore = new TaskStore(taskBasicStore); > ``` Only in AgentManager will a TaskManager object be created public AgentManager() { conf = AgentConfiguration.getAgentConf(); agentConfMonitor = Executors.newSingleThreadExecutor(); taskManager = new TaskManager(); -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org