You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "complone (via GitHub)" <gi...@apache.org> on 2023/05/21 08:28:11 UTC

[GitHub] [rocketmq-eventbridge] complone opened a new pull request, #106: feat: Add a daemon thread to ensure that it will not exit abnormally

complone opened a new pull request, #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106

   Daemon thread: ensure that the three threads of EventBusListener, EventRuleTransfer and EventTargetPusher will not exit abnormally; at the same time, exit normally and receive the signal of Kill-15 (otherwise the virtual machine cannot exit normally)


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

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


[GitHub] [rocketmq-eventbridge] 2011shenlin merged pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "2011shenlin (via GitHub)" <gi...@apache.org>.
2011shenlin merged PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106


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

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


[GitHub] [rocketmq-eventbridge] complone commented on pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "complone (via GitHub)" <gi...@apache.org>.
complone commented on PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106#issuecomment-1556117930

   Since PR#94 handles conflicts, open a new PR to handle


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

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


[GitHub] [rocketmq-eventbridge] Jashinck commented on a diff in pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "Jashinck (via GitHub)" <gi...@apache.org>.
Jashinck commented on code in PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106#discussion_r1199866720


##########
adapter/runtime/src/main/java/org/apache/rocketmq/eventbridge/adapter/runtime/boot/EventRuleTransfer.java:
##########
@@ -75,15 +77,15 @@ public void run() {
                 this.waitForRunning(1000);
                 continue;
             }
-            Map<String, TransformEngine<ConnectRecord>> latestTransformMap = circulatorContext.getTaskTransformMap();
+            latestTransformMap = circulatorContext.getTaskTransformMap();
             if (MapUtils.isEmpty(latestTransformMap)) {
                 logger.warn("latest transform engine is empty, continue by curTime - {}", System.currentTimeMillis());
                 this.waitForRunning(3000);
                 continue;
             }
 
             List<ConnectRecord> afterTransformConnect = Lists.newArrayList();
-            List<CompletableFuture<Void>> completableFutures = Lists.newArrayList();

Review Comment:
   此处局部变量,不需要全局化,主线程关闭后,资源无需手动释放



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

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


[GitHub] [rocketmq-eventbridge] complone commented on a diff in pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "complone (via GitHub)" <gi...@apache.org>.
complone commented on code in PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106#discussion_r1204909666


##########
adapter/runtime/src/main/java/org/apache/rocketmq/eventbridge/adapter/runtime/boot/EventRuleTransfer.java:
##########
@@ -75,15 +77,15 @@ public void run() {
                 this.waitForRunning(1000);
                 continue;
             }
-            Map<String, TransformEngine<ConnectRecord>> latestTransformMap = circulatorContext.getTaskTransformMap();
+            latestTransformMap = circulatorContext.getTaskTransformMap();
             if (MapUtils.isEmpty(latestTransformMap)) {
                 logger.warn("latest transform engine is empty, continue by curTime - {}", System.currentTimeMillis());
                 this.waitForRunning(3000);
                 continue;
             }
 
             List<ConnectRecord> afterTransformConnect = Lists.newArrayList();
-            List<CompletableFuture<Void>> completableFutures = Lists.newArrayList();

Review Comment:
   done



##########
adapter/runtime/src/main/java/org/apache/rocketmq/eventbridge/adapter/runtime/boot/EventRuleTransfer.java:
##########
@@ -75,15 +77,15 @@ public void run() {
                 this.waitForRunning(1000);
                 continue;
             }
-            Map<String, TransformEngine<ConnectRecord>> latestTransformMap = circulatorContext.getTaskTransformMap();

Review Comment:
   done



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

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


[GitHub] [rocketmq-eventbridge] Jashinck commented on a diff in pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "Jashinck (via GitHub)" <gi...@apache.org>.
Jashinck commented on code in PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106#discussion_r1204913064


##########
adapter/runtime/src/main/java/org/apache/rocketmq/eventbridge/adapter/runtime/boot/EventRuleTransfer.java:
##########
@@ -117,4 +117,18 @@ public void run() {
         }
     }
 
+    @Override
+    public void start() {
+        thread.start();
+    }
+
+    @Override
+    public void shutdown() {
+        try {
+            circulatorContext.releaseTaskTransform();
+        } catch (Exception e) {
+            e.printStackTrace();

Review Comment:
   打印具体业务领域及其堆栈信息,不建议直接打印堆栈信息。下同(Transfer, Trigger)



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

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


[GitHub] [rocketmq-eventbridge] Jashinck commented on a diff in pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "Jashinck (via GitHub)" <gi...@apache.org>.
Jashinck commented on code in PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106#discussion_r1199867083


##########
adapter/runtime/src/main/java/org/apache/rocketmq/eventbridge/adapter/runtime/boot/EventRuleTransfer.java:
##########
@@ -75,15 +77,15 @@ public void run() {
                 this.waitForRunning(1000);
                 continue;
             }
-            Map<String, TransformEngine<ConnectRecord>> latestTransformMap = circulatorContext.getTaskTransformMap();

Review Comment:
   变量,不需要全局化,资源释放参考下文CirculatorContext中:releaseTaskTransform方法,新建方法在CirculatorContext中完成相关资源释放。



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

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


[GitHub] [rocketmq-eventbridge] Jashinck commented on a diff in pull request #106: feat: Add a daemon thread to ensure that it will not exit abnormally

Posted by "Jashinck (via GitHub)" <gi...@apache.org>.
Jashinck commented on code in PR #106:
URL: https://github.com/apache/rocketmq-eventbridge/pull/106#discussion_r1204912580


##########
adapter/runtime/src/main/java/org/apache/rocketmq/eventbridge/adapter/runtime/Runtime.java:
##########
@@ -58,17 +64,40 @@ public class Runtime {
     private ErrorHandler errorHandler;
 
     @PostConstruct
-    public void initAndStart() {
-        logger.info("Start init runtime.");
+    public void initAndStart() throws Exception {
+        logger.info("Start init runtimer.");

Review Comment:
   runtimer -> runtime



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

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