You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "justinwwhuang (via GitHub)" <gi...@apache.org> on 2024/03/28 12:24:16 UTC

[PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

justinwwhuang opened a new pull request, #9892:
URL: https://github.com/apache/inlong/pull/9892

   [INLONG-9858][Agent] Increase local read and write capabilities for module config
   - Fixes #9858
   
   ### Motivation
   Increase local read and write capabilities for module config
   
   ### Modifications
   
   Increase local read and write capabilities for module config
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542988461


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {
+            InputStream inputStream = new FileInputStream(confPath + LOCAL_CONFIG_FILE);
+            if (inputStream != null) {
+                reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);

Review Comment:
   It's recommand to use  try-with-resource for `Reader` as the `saveToLocalFile()` method does 



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542985624


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {

Review Comment:
   try-with-resource for `Reader` as the `saveToLocalFile()` method does is better



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1543945428


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {
+            InputStream inputStream = new FileInputStream(confPath + LOCAL_CONFIG_FILE);
+            if (inputStream != null) {
+                reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
+                JsonElement tmpElement = JsonParser.parseReader(reader).getAsJsonObject();
+                ConfigResult curConfig = GSON.fromJson(tmpElement.getAsJsonObject(), ConfigResult.class);
+                if (curConfig.getMd5() != null && curConfig.getModuleList() != null) {
+                    currentMd5 = curConfig.getMd5();
+                    curConfig.getModuleList().forEach((module) -> {
+                        currentModules.put(module.getId(), module);
+                    });
+                } else {
+                    LOGGER.info("modules in local file invalid");
+                }
+            } else {
+                LOGGER.info("local module json file new FileInputStream failed");
+            }
+        } catch (FileNotFoundException e) {
+            LOGGER.info("local module json file not found");

Review Comment:
   Got it! Thank you for your explanation.



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542985624


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {

Review Comment:
   try-with-resource is better just as the `saveToLocalFile` does



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542985624


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {

Review Comment:
   try-with-resource for `Reader` as the `saveToLocalFile()` method does is better



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542968505


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {
+            InputStream inputStream = new FileInputStream(confPath + LOCAL_CONFIG_FILE);
+            if (inputStream != null) {
+                reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
+                JsonElement tmpElement = JsonParser.parseReader(reader).getAsJsonObject();
+                ConfigResult curConfig = GSON.fromJson(tmpElement.getAsJsonObject(), ConfigResult.class);
+                if (curConfig.getMd5() != null && curConfig.getModuleList() != null) {
+                    currentMd5 = curConfig.getMd5();
+                    curConfig.getModuleList().forEach((module) -> {
+                        currentModules.put(module.getId(), module);
+                    });
+                } else {
+                    LOGGER.info("modules in local file invalid");
+                }
+            } else {
+                LOGGER.info("local module json file new FileInputStream failed");
+            }
+        } catch (FileNotFoundException e) {
+            LOGGER.info("local module json file not found");

Review Comment:
   LOGGER.warn or LOGGER.error



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542968505


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {
+            InputStream inputStream = new FileInputStream(confPath + LOCAL_CONFIG_FILE);
+            if (inputStream != null) {
+                reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
+                JsonElement tmpElement = JsonParser.parseReader(reader).getAsJsonObject();
+                ConfigResult curConfig = GSON.fromJson(tmpElement.getAsJsonObject(), ConfigResult.class);
+                if (curConfig.getMd5() != null && curConfig.getModuleList() != null) {
+                    currentMd5 = curConfig.getMd5();
+                    curConfig.getModuleList().forEach((module) -> {
+                        currentModules.put(module.getId(), module);
+                    });
+                } else {
+                    LOGGER.info("modules in local file invalid");
+                }
+            } else {
+                LOGGER.info("local module json file new FileInputStream failed");
+            }
+        } catch (FileNotFoundException e) {
+            LOGGER.info("local module json file not found");

Review Comment:
   LOGGER.warn or LOGGER.error for exception



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "justinwwhuang (via GitHub)" <gi...@apache.org>.
justinwwhuang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1543155719


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);
             while (isRunnable()) {
                 try {
-                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                     dealWithConfigQueue(configQueue);
                     AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TASK_MGR_HEARTBEAT, "", "",
                             AgentUtils.getCurrentTime(), 1, 1);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 } catch (Throwable ex) {
                     LOGGER.error("exception caught", ex);
                     ThreadUtils.threadThrowableHandler(Thread.currentThread(), ex);
+                    AgentUtils.silenceSleepInMs(CORE_THREAD_SLEEP_TIME);
                 }
             }
         };
     }
 
+    public void restoreFromLocalFile(String confPath) {
+        LOGGER.info("restore modules from local file");
+        Reader reader = null;
+        try {
+            InputStream inputStream = new FileInputStream(confPath + LOCAL_CONFIG_FILE);
+            if (inputStream != null) {
+                reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
+                JsonElement tmpElement = JsonParser.parseReader(reader).getAsJsonObject();
+                ConfigResult curConfig = GSON.fromJson(tmpElement.getAsJsonObject(), ConfigResult.class);
+                if (curConfig.getMd5() != null && curConfig.getModuleList() != null) {
+                    currentMd5 = curConfig.getMd5();
+                    curConfig.getModuleList().forEach((module) -> {
+                        currentModules.put(module.getId(), module);
+                    });
+                } else {
+                    LOGGER.info("modules in local file invalid");
+                }
+            } else {
+                LOGGER.info("local module json file new FileInputStream failed");
+            }
+        } catch (FileNotFoundException e) {
+            LOGGER.info("local module json file not found");

Review Comment:
   Even if there are no files, it is considered normal



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1542998597


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);

Review Comment:
   One thing I am concerned about is whether the result of `restoreFromLocalFile` has effects on `dealWithConfigQueue`.
   i.e. does the `dealWithConfigQueue` method be invoked even if the `restoreFromLocalFile` finished in exception?
   
   



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1543005105


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -81,8 +95,8 @@ public HttpManager getHttpManager(InstallerConfiguration conf) {
                 DEFAULT_AGENT_MANAGER_VIP_HTTP_PREFIX_PATH);
         int timeout = conf.getInt(AGENT_MANAGER_REQUEST_TIMEOUT,
                 DEFAULT_AGENT_MANAGER_REQUEST_TIMEOUT);
-        String secretId = conf.get(MANAGER_AUTH_SECRET_ID);
-        String secretKey = conf.get(MANAGER_AUTH_SECRET_KEY);
+        String secretId = conf.get(MANAGER_AUTH_SECRET_ID, "");

Review Comment:
   This modification changes the behavior.
   Without this pull request, this line will throw an exception if the `secretId` is not configured, but nothing happens with this pull request.



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #9892:
URL: https://github.com/apache/inlong/pull/9892


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-9858][Agent] Increase local read and write capabilities for module config [inlong]

Posted by "justinwwhuang (via GitHub)" <gi...@apache.org>.
justinwwhuang commented on code in PR #9892:
URL: https://github.com/apache/inlong/pull/9892#discussion_r1543138933


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java:
##########
@@ -106,51 +120,110 @@ public String getCurrentMd5() {
         return currentMd5;
     }
 
+    public ModuleConfig getModule(Integer moduleId) {
+        return currentModules.get(moduleId);
+    }
+
     /**
-     * thread for core thread.
+     * Thread for core thread.
      *
      * @return runnable profile.
      */
     private Runnable coreThread() {
         return () -> {
-            Thread.currentThread().setName("task-manager-core");
+            Thread.currentThread().setName("module-manager-core");
+            restoreFromLocalFile(confPath);

Review Comment:
   yes, dealWithConfigQueue method WILL be invoked even if the restoreFromLocalFile finished in exception



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org