You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/02/27 00:19:22 UTC

[GitHub] [incubator-inlong] pocozh opened a new pull request #2767: [INLONG-2751][Manager] Fix the response code while query failing

pocozh opened a new pull request #2767:
URL: https://github.com/apache/incubator-inlong/pull/2767


   ### Title Name: [INLONG-2751][Manager] Fix the response code while query failing
   
   Fixes #2751 
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   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 followup 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



[GitHub] [incubator-inlong] pocozh commented on a change in pull request #2767: [INLONG-2751][Manager] Fix the response code while query failing

Posted by GitBox <gi...@apache.org>.
pocozh commented on a change in pull request #2767:
URL: https://github.com/apache/incubator-inlong/pull/2767#discussion_r815387541



##########
File path: inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/ConfigManager.java
##########
@@ -287,14 +288,15 @@ private boolean checkWithManager(String host, String proxyClusterName) {
                 Map<String, String> groupIdToMValue = new HashMap<String, String>();
                 Map<String, String> mqConfig = new HashMap<>();// include url2token and other params
 
-                if (configJson.getErrCode() == 0) {
+                if (configJson.isSuccess()) { //success get config
+                    LOG.info("getConfig_v2 result: {}", returnStr);
                     /*
                      * get mqUrls <->token maps;
                      * if mq is pulsar, store format: third-party-cluster.index1=cluster1url1,cluster1url2=token
                      * if mq is tubemq, token is "", store format: third-party-cluster.index1=cluster1url1,cluster1url2=
                      */
                     int index = 1;
-                    List<ThirdPartyClusterInfo> clusterSet = configJson.getPulsarSet();
+                    List<ThirdPartyClusterInfo> clusterSet = configJson.getData().getMqSet();

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

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



[GitHub] [incubator-inlong] healchow commented on a change in pull request #2767: [INLONG-2751][Manager] Fix the response code while query failing

Posted by GitBox <gi...@apache.org>.
healchow commented on a change in pull request #2767:
URL: https://github.com/apache/incubator-inlong/pull/2767#discussion_r815383061



##########
File path: inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/ConfigManager.java
##########
@@ -287,14 +288,15 @@ private boolean checkWithManager(String host, String proxyClusterName) {
                 Map<String, String> groupIdToMValue = new HashMap<String, String>();
                 Map<String, String> mqConfig = new HashMap<>();// include url2token and other params
 
-                if (configJson.getErrCode() == 0) {
+                if (configJson.isSuccess()) { //success get config
+                    LOG.info("getConfig_v2 result: {}", returnStr);
                     /*
                      * get mqUrls <->token maps;
                      * if mq is pulsar, store format: third-party-cluster.index1=cluster1url1,cluster1url2=token
                      * if mq is tubemq, token is "", store format: third-party-cluster.index1=cluster1url1,cluster1url2=
                      */
                     int index = 1;
-                    List<ThirdPartyClusterInfo> clusterSet = configJson.getPulsarSet();
+                    List<ThirdPartyClusterInfo> clusterSet = configJson.getData().getMqSet();

Review comment:
       `configJson.getData()` may be null, so direct call `getMqSet()` may cause a null pointer 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



[GitHub] [incubator-inlong] healchow merged pull request #2767: [INLONG-2751][Manager] Fix the response code while query failing

Posted by GitBox <gi...@apache.org>.
healchow merged pull request #2767:
URL: https://github.com/apache/incubator-inlong/pull/2767


   


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



[GitHub] [incubator-inlong] healchow commented on a change in pull request #2767: [INLONG-2751][Manager] Fix the response code while query failing

Posted by GitBox <gi...@apache.org>.
healchow commented on a change in pull request #2767:
URL: https://github.com/apache/incubator-inlong/pull/2767#discussion_r815384848



##########
File path: inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/ConfigManager.java
##########
@@ -287,14 +288,15 @@ private boolean checkWithManager(String host, String proxyClusterName) {
                 Map<String, String> groupIdToMValue = new HashMap<String, String>();
                 Map<String, String> mqConfig = new HashMap<>();// include url2token and other params
 
-                if (configJson.getErrCode() == 0) {
+                if (configJson.isSuccess()) { //success get config
+                    LOG.info("getConfig_v2 result: {}", returnStr);
                     /*
                      * get mqUrls <->token maps;
                      * if mq is pulsar, store format: third-party-cluster.index1=cluster1url1,cluster1url2=token
                      * if mq is tubemq, token is "", store format: third-party-cluster.index1=cluster1url1,cluster1url2=
                      */
                     int index = 1;
-                    List<ThirdPartyClusterInfo> clusterSet = configJson.getPulsarSet();
+                    List<ThirdPartyClusterInfo> clusterSet = configJson.getData().getMqSet();

Review comment:
       I don't see a check that `mqSet` and `topicList` are not null in the method of `configJson.isSuccess()`.
   
   I mean, `configJson.isSuccess()` may be true, but `configJson.getData()` is null.




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



[GitHub] [incubator-inlong] pocozh commented on a change in pull request #2767: [INLONG-2751][Manager] Fix the response code while query failing

Posted by GitBox <gi...@apache.org>.
pocozh commented on a change in pull request #2767:
URL: https://github.com/apache/incubator-inlong/pull/2767#discussion_r815383498



##########
File path: inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/ConfigManager.java
##########
@@ -287,14 +288,15 @@ private boolean checkWithManager(String host, String proxyClusterName) {
                 Map<String, String> groupIdToMValue = new HashMap<String, String>();
                 Map<String, String> mqConfig = new HashMap<>();// include url2token and other params
 
-                if (configJson.getErrCode() == 0) {
+                if (configJson.isSuccess()) { //success get config
+                    LOG.info("getConfig_v2 result: {}", returnStr);
                     /*
                      * get mqUrls <->token maps;
                      * if mq is pulsar, store format: third-party-cluster.index1=cluster1url1,cluster1url2=token
                      * if mq is tubemq, token is "", store format: third-party-cluster.index1=cluster1url1,cluster1url2=
                      */
                     int index = 1;
-                    List<ThirdPartyClusterInfo> clusterSet = configJson.getPulsarSet();
+                    List<ThirdPartyClusterInfo> clusterSet = configJson.getData().getMqSet();

Review comment:
       There is a `configJson.isSuccess()` judgement in line 291. Only when `mqSet` and `topicList` are not null, `configJson.isSuccess()` is true.




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