You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2023/04/06 01:24:10 UTC

[inlong] branch master updated: [INLONG-7769][DataProxy] Fix NPE when request Inlong Manager failed (#7770)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang 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 65e44b4e9 [INLONG-7769][DataProxy] Fix NPE when request Inlong Manager failed (#7770)
65e44b4e9 is described below

commit 65e44b4e934fcaa0b55e90bf065a4408205f1026
Author: vernedeng <de...@pku.edu.cn>
AuthorDate: Thu Apr 6 09:24:04 2023 +0800

    [INLONG-7769][DataProxy] Fix NPE when request Inlong Manager failed (#7770)
---
 .../org/apache/inlong/dataproxy/config/RemoteConfigManager.java     | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/RemoteConfigManager.java b/inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/RemoteConfigManager.java
index dc2548edb..8f50930c5 100644
--- a/inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/RemoteConfigManager.java
+++ b/inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/config/RemoteConfigManager.java
@@ -205,6 +205,12 @@ public class RemoteConfigManager implements IRepository {
             LOGGER.info("start to request {} to get config info with params {}", url, request);
             CloseableHttpResponse response = httpClient.execute(httpPost);
             String returnStr = EntityUtils.toString(response.getEntity());
+
+            if (response.getStatusLine().getStatusCode() != 200) {
+                LOGGER.info("failed to request {}, the response is {}", url, returnStr);
+                return false;
+            }
+
             LOGGER.info("end to request {} to get config info:{}", url, returnStr);
             // get groupId <-> topic and m value.