Re: [PR] [INLONG-10873][SDK] Transform support factorial function [inlong]

2024-11-03 Thread via GitHub


github-actions[bot] commented on PR #10874:
URL: https://github.com/apache/inlong/pull/10874#issuecomment-2453704759

   This PR is stale because it has been open for 60 days with no activity.


-- 
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



Re: [PR] [INLONG-11451][Agent] Prevent Installer from detecting process misjudgment [inlong]

2024-11-03 Thread via GitHub


justinwwhuang merged PR #11452:
URL: https://github.com/apache/inlong/pull/11452


-- 
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



(inlong) branch master updated: [INLONG-11451][Agent] When the installer detects that the process does not exist, it increases the wait for retry to prevent misjudgment (#11452)

2024-11-03 Thread wenweihuang
This is an automated email from the ASF dual-hosted git repository.

wenweihuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
 new 8b8faa6816 [INLONG-11451][Agent] When the installer detects that the 
process does not exist, it increases the wait for retry to prevent misjudgment 
(#11452)
8b8faa6816 is described below

commit 8b8faa68169164f6e404d76681c7fc57174d8143
Author: justinwwhuang 
AuthorDate: Mon Nov 4 14:23:03 2024 +0800

[INLONG-11451][Agent] When the installer detects that the process does not 
exist, it increases the wait for retry to prevent misjudgment (#11452)
---
 .../inlong/agent/installer/ModuleManager.java  | 37 +-
 .../src/test/java/installer/TestModuleManager.java |  2 +-
 2 files changed, 23 insertions(+), 16 deletions(-)

diff --git 
a/inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java
 
b/inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java
index cb92576c3c..de05a9d0f7 100755
--- 
a/inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java
+++ 
b/inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java
@@ -80,6 +80,7 @@ public class ModuleManager extends AbstractDaemon {
 public static final String LOCAL_CONFIG_FILE = "modules.json";
 private static final Logger LOGGER = 
LoggerFactory.getLogger(ModuleManager.class);
 public static final int MAX_MODULE_SIZE = 10;
+public static final int CHECK_PROCESS_TIMES = 20;
 private final InstallerConfiguration conf;
 private final String confPath;
 private final BlockingQueue configQueue;
@@ -345,7 +346,7 @@ public class ModuleManager extends AbstractDaemon {
 }
 break;
 case INSTALLED:
-if (!isProcessAllStarted(module)) {
+if (!isProcessAllStarted(module, CHECK_PROCESS_TIMES)) {
 LOGGER.info("module {}({}) process not all started try 
to start", module.getId(),
 module.getName());
 if (!startModule(module)) {
@@ -495,7 +496,7 @@ public class ModuleManager extends AbstractDaemon {
 String ret = ExcuteLinux.exeCmd(module.getStartCommand());
 LOGGER.info("start module {}({}) proc[{}] return {} ", 
module.getId(), module.getName(), i, ret);
 }
-if (isProcessAllStarted(module)) {
+if (isProcessAllStarted(module, CHECK_PROCESS_TIMES)) {
 LOGGER.info("start module {}({}) success", module.getId(), 
module.getName());
 return true;
 } else {
@@ -517,21 +518,27 @@ public class ModuleManager extends AbstractDaemon {
 LOGGER.info("uninstall module {}({}) return {} ", module.getId(), 
module.getName(), ret);
 }
 
-private boolean isProcessAllStarted(ModuleConfig module) {
-String ret = ExcuteLinux.exeCmd(module.getCheckCommand());
-if (ret == null) {
-LOGGER.error("get module {}({}) process num failed", 
module.getId(), module.getName());
-return false;
-}
-String[] processArray = ret.split("\n");
-int cnt = 0;
-for (int i = 0; i < processArray.length; i++) {
-if (processArray[i].length() > 0) {
-cnt++;
+private boolean isProcessAllStarted(ModuleConfig module, int times) {
+for (int check = 0; check < times; check++) {
+AgentUtils.silenceSleepInSeconds(1);
+String ret = ExcuteLinux.exeCmd(module.getCheckCommand());
+if (ret == null) {
+LOGGER.error("[{}] get module {}({}) process num failed", 
check, module.getId(), module.getName());
+continue;
+}
+String[] processArray = ret.split("\n");
+int cnt = 0;
+for (int i = 0; i < processArray.length; i++) {
+if (processArray[i].length() > 0) {
+cnt++;
+}
+}
+LOGGER.info("[{}] get module {}({}) process num {}", check, 
module.getId(), module.getName(), cnt);
+if (cnt >= module.getProcessesNum()) {
+return true;
 }
 }
-LOGGER.info("get module {}({}) process num {}", module.getId(), 
module.getName(), cnt);
-return cnt >= module.getProcessesNum();
+return false;
 }
 
 private boolean downloadModule(ModuleConfig module) {
diff --git 
a/inlong-agent/agent-installer/src/test/java/installer/TestModuleManager.java 
b/inlong-agent/agent-installer/src/test/java/installer/TestModuleManager.java
index ecd2383bf0..240fc7357f 100755
--- 
a/inlong-agent/agent-installer/src/test/java/installer/TestModuleManager.java
+++ 
b/inlong-agent/agent-i

[PR] [INLONG-11451][Agent] Prevent Installer from detecting process misjudgment [inlong]

2024-11-03 Thread via GitHub


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

   Fixes #11451 
   
   ### Motivation
   
   The current Installer detection interval is too short, which can easily lead 
to misjudgment
   
   ### Modifications
   
   When the Installer detects that the process does not exist, it increases the 
wait for retry to prevent misjudgment
   
   ### 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
   
   No doc needed
   


-- 
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