You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/02/23 01:05:13 UTC

[skywalking] branch bug created (now 0cfcf369f2)

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

wusheng pushed a change to branch bug
in repository https://gitbox.apache.org/repos/asf/skywalking.git


      at 0cfcf369f2 Add explicit `ReadTimeout` for ConsulConfigurationWatcher

This branch includes the following new commits:

     new 0cfcf369f2 Add explicit `ReadTimeout` for ConsulConfigurationWatcher

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: Add explicit `ReadTimeout` for ConsulConfigurationWatcher

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch bug
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 0cfcf369f2e0c9829095c4a037c452f4af770bd7
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Feb 23 09:04:55 2023 +0800

    Add explicit `ReadTimeout` for ConsulConfigurationWatcher
---
 docs/en/changes/changes.md                              |  1 +
 oap-server-bom/pom.xml                                  | 17 +++++++++++++++++
 .../server-cluster-plugin/cluster-consul-plugin/pom.xml |  1 -
 .../server-configuration/configuration-consul/pom.xml   |  5 -----
 .../consul/ConsulConfigurationWatcherRegister.java      |  3 ++-
 5 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index e8bdfbd017..5371d53c9e 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -102,6 +102,7 @@
 * Support Amazon DynamoDB monitoring.
 * Support prometheus HTTP API and promQL.
 * `Scope` in the Entity of Metrics query v1 protocol is not required and automatical correction. The scope is determined based on the metric itself.
+* Add explicit `ReadTimeout` for ConsulConfigurationWatcher to avoid `IllegalArgumentException: Cache watchInterval=10sec >= networkClientReadTimeout=10000ms`.
 
 #### UI
 
diff --git a/oap-server-bom/pom.xml b/oap-server-bom/pom.xml
index 0a664d1fa6..289353d600 100644
--- a/oap-server-bom/pom.xml
+++ b/oap-server-bom/pom.xml
@@ -75,6 +75,7 @@
         <banyandb-java-client.version>0.3.0</banyandb-java-client.version>
         <kafka-clients.version>2.8.1</kafka-clients.version>
         <spring-kafka-test.version>2.4.6.RELEASE</spring-kafka-test.version>
+        <consul.client.version>1.5.3</consul.client.version>
     </properties>
 
     <dependencyManagement>
@@ -581,6 +582,22 @@
                 <version>${spring-kafka-test.version}</version>
                 <scope>test</scope>
             </dependency>
+
+            <dependency>
+                <groupId>com.orbitz.consul</groupId>
+                <artifactId>consul-client</artifactId>
+                <version>${consul.client.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>com.google.guava</groupId>
+                        <artifactId>guava</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-api</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 </project>
diff --git a/oap-server/server-cluster-plugin/cluster-consul-plugin/pom.xml b/oap-server/server-cluster-plugin/cluster-consul-plugin/pom.xml
index 57c48e6b58..860bbb99c5 100644
--- a/oap-server/server-cluster-plugin/cluster-consul-plugin/pom.xml
+++ b/oap-server/server-cluster-plugin/cluster-consul-plugin/pom.xml
@@ -37,7 +37,6 @@
         <dependency>
             <groupId>com.orbitz.consul</groupId>
             <artifactId>consul-client</artifactId>
-            <version>1.5.3</version>
             <exclusions>
                 <exclusion>
                     <groupId>com.google.guava</groupId>
diff --git a/oap-server/server-configuration/configuration-consul/pom.xml b/oap-server/server-configuration/configuration-consul/pom.xml
index cb5cae0eac..c08414ab61 100644
--- a/oap-server/server-configuration/configuration-consul/pom.xml
+++ b/oap-server/server-configuration/configuration-consul/pom.xml
@@ -28,10 +28,6 @@
 
     <artifactId>configuration-consul</artifactId>
 
-    <properties>
-        <consul.client.version>1.2.6</consul.client.version>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.skywalking</groupId>
@@ -48,7 +44,6 @@
         <dependency>
             <groupId>com.orbitz.consul</groupId>
             <artifactId>consul-client</artifactId>
-            <version>${consul.client.version}</version>
             <exclusions>
                 <exclusion>
                     <groupId>com.google.guava</groupId>
diff --git a/oap-server/server-configuration/configuration-consul/src/main/java/org/apache/skywalking/oap/server/configuration/consul/ConsulConfigurationWatcherRegister.java b/oap-server/server-configuration/configuration-consul/src/main/java/org/apache/skywalking/oap/server/configuration/consul/ConsulConfigurationWatcherRegister.java
index 0f53568d9e..2ad8b08471 100644
--- a/oap-server/server-configuration/configuration-consul/src/main/java/org/apache/skywalking/oap/server/configuration/consul/ConsulConfigurationWatcherRegister.java
+++ b/oap-server/server-configuration/configuration-consul/src/main/java/org/apache/skywalking/oap/server/configuration/consul/ConsulConfigurationWatcherRegister.java
@@ -59,7 +59,8 @@ public class ConsulConfigurationWatcherRegister extends ConfigWatcherRegister {
                                                                                 .withDefaultPort(DEFAULT_PORT))
                                                  .collect(Collectors.toList());
 
-        Consul.Builder builder = Consul.builder().withConnectTimeoutMillis(3000);
+        Consul.Builder builder = Consul.builder().withConnectTimeoutMillis(3_000)
+                                       .withReadTimeoutMillis(20_000);
 
         if (hostAndPorts.size() == 1) {
             builder.withHostAndPort(hostAndPorts.get(0));