This is an automated email from the ASF dual-hosted git repository.
lushiji pushed a commit to branch branch-4.17
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.17 by this push:
new 05f2d1114a Adjust DNS cache expiration in tests to reduce test timeout
failures (#4586)
05f2d1114a is described below
commit 05f2d1114a0f6fbbaa61f9f5e32e6424d6453edb
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Apr 22 22:37:55 2025 +0300
Adjust DNS cache expiration in tests to reduce test timeout failures (#4586)
(cherry picked from commit 7fbb8d89f880579035b5ba2752caf8583d34611a)
---
.github/workflows/bk-ci.yml | 14 ++++++++++++++
pom.xml | 6 +++---
stream/distributedlog/common/pom.xml | 2 +-
stream/distributedlog/core/pom.xml | 2 +-
stream/distributedlog/pom.xml | 2 +-
stream/pom.xml | 2 +-
tests/integration-tests-base-groovy/pom.xml | 2 +-
7 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/bk-ci.yml b/.github/workflows/bk-ci.yml
index e73670eaee..c6cf31ec65 100644
--- a/.github/workflows/bk-ci.yml
+++ b/.github/workflows/bk-ci.yml
@@ -155,6 +155,13 @@ jobs:
distribution: 'temurin'
java-version: 11
+ - name: Tune Java DNS TTL settings
+ run: |
+ sudo tee -a $JAVA_HOME/conf/security/java.security <<EOF
+ networkaddress.cache.ttl=1
+ networkaddress.cache.negative.ttl=1
+ EOF
+
- name: Build
run: |
projects_list=
@@ -229,6 +236,13 @@ jobs:
distribution: 'temurin'
java-version: 11
+ - name: Tune Java DNS TTL settings
+ run: |
+ sudo tee -a $JAVA_HOME/conf/security/java.security <<EOF
+ networkaddress.cache.ttl=1
+ networkaddress.cache.negative.ttl=1
+ EOF
+
- name: Pick ubuntu mirror for the docker image build
run: |
# pick the closest ubuntu mirror and set it to UBUNTU_MIRROR
environment variable
diff --git a/pom.xml b/pom.xml
index 1ee8e1463b..9e503def15 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1017,7 +1017,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>-Xmx2G -Djava.net.preferIPv4Stack=true
-Dio.netty.leakDetection.level=paranoid ${test.additional.args}</argLine>
+ <argLine>-Xmx2G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
-Dio.netty.leakDetection.level=paranoid ${test.additional.args}</argLine>
<redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
<forkCount>${forkCount.variable}</forkCount>
<reuseForks>false</reuseForks>
@@ -1298,7 +1298,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>-Xmx2G -Djava.net.preferIPv4Stack=true</argLine>
+ <argLine>-Xmx2G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true</argLine>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<forkCount>${forkCount.variable}</forkCount>
<reuseForks>false</reuseForks>
@@ -1318,7 +1318,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>-Xmx2G -Djava.net.preferIPv4Stack=true
-Dio.netty.leakDetection.level=paranoid -Dbookkeeper.log.root.level=INFO
-Dbookkeeper.log.root.appender=CONSOLE</argLine>
+ <argLine>-Xmx2G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
-Dio.netty.leakDetection.level=paranoid -Dbookkeeper.log.root.level=INFO
-Dbookkeeper.log.root.appender=CONSOLE</argLine>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<forkCount>${forkCount.variable}</forkCount>
<reuseForks>false</reuseForks>
diff --git a/stream/distributedlog/common/pom.xml
b/stream/distributedlog/common/pom.xml
index ba9d3a6dc9..06b2ecac2b 100644
--- a/stream/distributedlog/common/pom.xml
+++ b/stream/distributedlog/common/pom.xml
@@ -109,7 +109,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
- <argLine>-Xmx3G -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G ${test.additional.args}</argLine>
+ <argLine>-Xmx3G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G ${test.additional.args}</argLine>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
diff --git a/stream/distributedlog/core/pom.xml
b/stream/distributedlog/core/pom.xml
index a36eef2892..396b3d40f4 100644
--- a/stream/distributedlog/core/pom.xml
+++ b/stream/distributedlog/core/pom.xml
@@ -110,7 +110,7 @@
<configuration>
<trimStackTrace>false</trimStackTrace>
<redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
- <argLine>-Xmx3G -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G ${test.additional.args}</argLine>
+ <argLine>-Xmx3G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G ${test.additional.args}</argLine>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
diff --git a/stream/distributedlog/pom.xml b/stream/distributedlog/pom.xml
index 47523196e4..8aa82a5db4 100644
--- a/stream/distributedlog/pom.xml
+++ b/stream/distributedlog/pom.xml
@@ -75,7 +75,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
- <argLine>-Xmx3G -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G -Dio.netty.leakDetection.level=PARANOID
${test.additional.args}</argLine>
+ <argLine>-Xmx3G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G -Dio.netty.leakDetection.level=PARANOID
${test.additional.args}</argLine>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
diff --git a/stream/pom.xml b/stream/pom.xml
index 91358ea1b5..72041e6d36 100644
--- a/stream/pom.xml
+++ b/stream/pom.xml
@@ -57,7 +57,7 @@
<!-- only run tests when -DstreamTests is specified //-->
<skipTests>true</skipTests>
<redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
- <argLine>-Xmx3G -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G -Dio.netty.leakDetection.level=PARANOID
${test.additional.args}</argLine>
+ <argLine>-Xmx3G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
-XX:MaxDirectMemorySize=2G -Dio.netty.leakDetection.level=PARANOID
${test.additional.args}</argLine>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
diff --git a/tests/integration-tests-base-groovy/pom.xml
b/tests/integration-tests-base-groovy/pom.xml
index 7ca9f11222..caa9a52775 100644
--- a/tests/integration-tests-base-groovy/pom.xml
+++ b/tests/integration-tests-base-groovy/pom.xml
@@ -68,7 +68,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>-Xmx4G -Djava.net.preferIPv4Stack=true
${test.additional.args}</argLine>
+ <argLine>-Xmx4G -Dsun.net.inetaddr.ttl=1
-Dsun.net.inetaddr.negative.ttl=1 -Djava.net.preferIPv4Stack=true
${test.additional.args}</argLine>
<forkCount>1</forkCount>
<useSystemClassLoader>false</useSystemClassLoader>
<systemPropertyVariables>