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 02:40:17 UTC

[skywalking] branch master updated: Add explicit `ReadTimeout` for ConsulConfigurationWatcher (#10431)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new d5928245d0 Add explicit `ReadTimeout` for ConsulConfigurationWatcher (#10431)
d5928245d0 is described below

commit d5928245d036556a313be8c80c482af2fd9cb006
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Feb 23 10:40:11 2023 +0800

    Add explicit `ReadTimeout` for ConsulConfigurationWatcher (#10431)
    
    * Add explicit `ReadTimeout` for ConsulConfigurationWatcher
    
    * Bump up skywalking-eyes
---
 .github/workflows/skywalking.yaml                       |  4 ++--
 docs/en/changes/changes.md                              |  3 ++-
 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 ++-
 6 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml
index 62b1a07c44..b543c9c410 100644
--- a/.github/workflows/skywalking.yaml
+++ b/.github/workflows/skywalking.yaml
@@ -41,7 +41,7 @@ jobs:
         with:
           submodules: true
       - name: Check license header
-        uses: apache/skywalking-eyes@bd8d2db65f2fea938b74401ae72b0365733bdfdc
+        uses: apache/skywalking-eyes@df70871af1a8109c9a5b1dc824faaf65246c5236
 
   code-style:
     if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule')
@@ -78,7 +78,7 @@ jobs:
           go-version: "1.16"
       - name: Check Dependencies Licenses
         run: |
-          go install github.com/apache/skywalking-eyes/cmd/license-eye@bd8d2db65f2fea938b74401ae72b0365733bdfdc
+          go install github.com/apache/skywalking-eyes/cmd/license-eye@df70871af1a8109c9a5b1dc824faaf65246c5236
           license-eye dependency resolve --summary ./dist-material/release-docs/LICENSE.tpl || exit 1
           if [ ! -z "$(git diff -U0 ./dist-material/release-docs/LICENSE)" ]; then
             echo "LICENSE file is not updated correctly"
diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index e8bdfbd017..b65ec2aaa7 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
 
@@ -134,7 +135,7 @@
 * Refactor: optimize the attached events visualization in the trace widget.
 * Update BanyanDB client to 0.3.0.
 * Add AWS DynamoDB menu.
-* [Add period.](fix: add auto period to the independent mode for widgets)
+* Fix: add auto period to the independent mode for widgets.
 * optimize menus and add Windows monitoring menu.
 
 #### Documentation
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));