You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/03 04:19:29 UTC

[GitHub] [rocketmq-connect] shy-share opened a new pull request, #386: [ISSUE #383]support failed task after connector restart

shy-share opened a new pull request, #386:
URL: https://github.com/apache/rocketmq-connect/pull/386

   ## What is the purpose of the change
   
   close #383 
   support failed task after connector restart
   ## Brief changelog
   
   XX
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq-connect/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
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-connect] odbozhou commented on pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
odbozhou commented on PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#issuecomment-1340439081

   > > please fix compile error
   > 
   > @odbozhou ok,already fixed. Isn't there some tool that automatically recognizes this formatting problem?
   
   https://rocketmq.apache.org/zh/docs/4.x/contributionGuide/30code-guidelines
   
   You can refer to this document, ide import checkstyle


-- 
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-connect] odbozhou commented on pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
odbozhou commented on PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#issuecomment-1338906130

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

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


[GitHub] [rocketmq-connect] odbozhou commented on a diff in pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
odbozhou commented on code in PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#discussion_r1050326089


##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/service/memory/MemoryConfigManagementServiceImpl.java:
##########
@@ -134,6 +134,38 @@ public void deleteConnectorConfig(String connectorName) {
         triggerListener();
     }
 
+    @Override
+    public void restartConnector(String connectorName) {

Review Comment:
   Because connect is distributed, there are generally multiple worker nodes, so connectors and tasks may run on other nodes, so the worker node that receives the restart request may not run the connector or task that needs to be restarted, so the task or connector When restarting, the configuration or status needs to be sent to the config topic, and each worker node receives the information in the config topic, in org.apache.rocketmq.connect.runtime.service.ConfigManagementServiceImpl.ConfigChangeCallback#onCompletion
   Handle the restart operation.



##########
rocketmq-connect-runtime/src/test/java/org/apache/rocketmq/connect/runtime/controller/distributed/TestConfigManagementService.java:
##########
@@ -58,6 +58,16 @@ public void deleteConnectorConfig(String connectorName) {
 
     }
 
+    @Override
+    public void restartConnector(String connectorName) {

Review Comment:
   Can you provide some test cases to verify this new feature



-- 
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-connect] shy-share commented on pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
shy-share commented on PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#issuecomment-1338981626

   > please fix compile error
   
   @odbozhou ok,already fixed. Isn't there some tool that automatically recognizes this formatting problem?


-- 
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-connect] odbozhou commented on a diff in pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
odbozhou commented on code in PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#discussion_r1041857552


##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/controller/AbstractConnectController.java:
##########
@@ -225,6 +225,25 @@ public void deleteConnectorConfig(String connectorName) {
         configManagementService.deleteConnectorConfig(connectorName);
     }
 
+    /**
+     * Restart the connector with the specified connector name in the cluster.
+     *
+     * @param connectorName
+     */
+    public void restartConnectorConfig(String connectorName) {

Review Comment:
   restartConnector may be more appropriate than restartConnectorConfig



##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/service/ConfigManagementService.java:
##########
@@ -76,6 +76,21 @@ default void configure(WorkerConfig config) {
      */
     void deleteConnectorConfig(String connectorName);
 
+    /**
+     * restart the connector with the specified connector name in the cluster.
+     *
+     * @param connectorName
+     */
+    void restartConnectorConfig(String connectorName);
+
+    /**
+     * restart the task with the specified task  in the cluster.
+     *
+     * @param connectorName
+     * @param task
+     */
+    void restartTaskConfig(String connectorName, Integer task);

Review Comment:
   restartTask may be more appropriate than restartTaskConfig



##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/service/ConfigManagementService.java:
##########
@@ -76,6 +76,21 @@ default void configure(WorkerConfig config) {
      */
     void deleteConnectorConfig(String connectorName);
 
+    /**
+     * restart the connector with the specified connector name in the cluster.
+     *
+     * @param connectorName
+     */
+    void restartConnectorConfig(String connectorName);

Review Comment:
   restartConnector may be more appropriate than restartConnectorConfig



##########
rocketmq-connect-runtime/src/main/java/org/apache/rocketmq/connect/runtime/controller/AbstractConnectController.java:
##########
@@ -225,6 +225,25 @@ public void deleteConnectorConfig(String connectorName) {
         configManagementService.deleteConnectorConfig(connectorName);
     }
 
+    /**
+     * Restart the connector with the specified connector name in the cluster.
+     *
+     * @param connectorName
+     */
+    public void restartConnectorConfig(String connectorName) {
+        configManagementService.restartConnectorConfig(connectorName);
+    }
+
+    /**
+     * Restart the task with the specified task name in the cluster.
+     *
+     * @param connectorName
+     * @param task
+     */
+    public void restartTaskConfig(String connectorName, Integer task) {

Review Comment:
   restartTask may be more appropriate than restartTaskConfig



-- 
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-connect] shy-share commented on pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
shy-share commented on PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#issuecomment-1341026581

   > Is it missing the processing of restart connector and task in ConfigChangeCallback#onCompletion?
   
   @odbozhou I have fixed the problem you mentioned, but how to stop the task, I still don't understand


-- 
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-connect] odbozhou commented on pull request #386: [ISSUE #383]support failed task after connector restart

Posted by GitBox <gi...@apache.org>.
odbozhou commented on PR #386:
URL: https://github.com/apache/rocketmq-connect/pull/386#issuecomment-1342093731

   > > Is it missing the processing of restart connector and task in ConfigChangeCallback#onCompletion?
   > 
   > @odbozhou I have fixed the problem you mentioned, but how to stop the task, I still don't understand
   
   org.apache.rocketmq.connect.runtime.connectorwrapper.Worker#awaitStopTask
   
   The worker has provided related methods to wait for the stop task


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