Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
88cd989
ZOOKEEPER-5039: Upgrade Mockito to 5.23.0 for JDK25
PDavid Apr 23, 2026
077fbdd
ZOOKEEPER-5039: Switch GH: Action workflows to JDK 17 and 25
PDavid May 4, 2026
e0684de
ZOOKEEPER-5039: Switch Jenkins workflows to JDK 17 and 25
PDavid May 4, 2026
a07e58e
ZOOKEEPER-5039: Upgrade spotbugs to support JDK 17
PDavid May 4, 2026
3c3df59
ZOOKEEPER-5039: Upgrade spotbugs to support Java 25
PDavid May 7, 2026
0a74e3b
ZOOKEEPER-5039: Upgrade burningwave mockdns to 0.27.2 for JDK25
PDavid Apr 24, 2026
9a95d36
ZOOKEEPER-5039: Fix PrometheusMetricsProviderConfigTest
PDavid May 7, 2026
9cad6d5
ZOOKEEPER-5039: Upgrade zookeeper/dev Docker image to JDK 17
PDavid May 8, 2026
58762dd
ZOOKEEPER-5039: Change Maven compiler source and target to 17
PDavid May 21, 2026
891909c
ZOOKEEPER-5039: Align Maven compiler Java versions
PDavid May 21, 2026
a6dff1e
ZOOKEEPER-5039: Update documentation
PDavid May 21, 2026
6a61f35
ZOOKEEPER-5039: Use Maven 3.8.8 in Dockerfile
PDavid Jun 16, 2026
56f47a7
ZOOKEEPER-5039: Fix SpotBugs VO_VOLATILE_INCREMENT in JvmPauseMonitor
PDavid Jun 17, 2026
859ba6f
ZOOKEEPER-5039: Install gnugpg in dev/docker/Dockerfile
PDavid Jun 22, 2026
e49e12c
ZOOKEEPER-5039: Added a small README for dev/docker/Dockerfile
PDavid Jun 22, 2026
21a1c02
ZOOKEEPER-5039: Update Java version related documentation
PDavid Jun 22, 2026
ccb70d7
ZOOKEEPER-5039: Add Maven enforcer rules for minimum Java and Maven v…
PDavid Jun 23, 2026
53e4717
ZOOKEEPER-5039: Use Java 25 in website GH Actions workflow
PDavid Jun 23, 2026
3958476
ZOOKEEPER-5039: Use newer ZooKeeper versions in "End to End Tests" GH…
PDavid Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
strategy:
matrix:
profile:
- name: 'full-build-jdk8'
jdk: 8
- name: 'full-build-jdk17'
jdk: 17
args: '-Pfull-build apache-rat:check verify -DskipTests spotbugs:check checkstyle:check'
- name: 'full-build-jdk11'
jdk: 11
- name: 'full-build-jdk25'
jdk: 25
args: '-Pfull-build apache-rat:check verify -DskipTests spotbugs:check checkstyle:check'
- name: 'full-build-java-tests'
jdk: 11
jdk: 25
args: '-Pfull-build verify -Dsurefire-forkcount=1 -DskipCppUnit -Dsurefire.rerunFailingTestsCount=5'
- name: 'full-build-cppunit-tests'
jdk: 11
jdk: 25
args: '-Pfull-build verify -Dtest=_ -DfailIfNoTests=false'
fail-fast: false
timeout-minutes: 360
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
compatibility:
strategy:
matrix:
jdk: [8, 11]
jdk: [17, 25]
zk: [3.5.9, 3.6.3, 3.7.0, nightly]
Comment thread
PDavid marked this conversation as resolved.
Outdated
fail-fast: false
timeout-minutes: 360
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.buildRef }}
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 11
java-version: 17
distribution: temurin
cache: 'maven'
- name: Show the first log message
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline {
axes {
axis {
name 'JAVA_VERSION'
values 'jdk_1.8_latest', 'jdk_11_latest'
values 'jdk_17_latest', 'jdk_25_latest'
}
}

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile-PreCommit
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline {

tools {
maven "maven_latest"
jdk "jdk_1.8_latest"
jdk "jdk_17_latest"
}

stages {
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="left">
<a href="https://zookeeper.apache.org/">
<img src="https://zookeeper.apache.org/images/zookeeper_small.gif"" alt="https://zookeeper.apache.org/"><br/>
<img src="https://zookeeper.apache.org/images/zookeeper_small.gif" alt="https://zookeeper.apache.org/"><br/>
</a>
</p>

Expand Down Expand Up @@ -39,11 +39,6 @@ is voted on and approved by the Apache ZooKeeper PMC:

https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper

## Java 8

If you are going to compile with Java 1.8, you should use a
recent release at u211 or above.

# Contributing
We always welcome new contributors to the project! See [How to Contribute](https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute) for details on how to submit patches as pull requests and other aspects of our contribution workflow.

Expand Down
5 changes: 3 additions & 2 deletions dev/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

FROM maven:3.8.4-jdk-11
FROM maven:3.8.8-eclipse-temurin-17
Comment thread
PDavid marked this conversation as resolved.

RUN apt-get update
RUN apt-get install -y \
Expand All @@ -31,4 +31,5 @@ RUN apt-get install -y \
libssl-dev \
libsasl2-modules-gssapi-mit \
libsasl2-modules \
libsasl2-dev
libsasl2-dev \
gnupg
3 changes: 3 additions & 0 deletions dev/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# About

Just run `dev/docker/run.sh` and you will have a Linux environment with all that is needed to build ZooKeeper, even on MacOs.
18 changes: 18 additions & 0 deletions excludeFindBugsFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,23 @@
<!-- this problem is to be addressed in ZOOKEEPER-3227 -->
<Bug pattern="DM_DEFAULT_ENCODING"/>

<!-- newly detected by SpotBugs 4.9.3; pre-existing code, not regressions -->
<Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="EI_EXPOSE_REP2"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
<Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
<Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>
<Bug pattern="AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE"/>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Bug pattern="DCN_NULLPOINTER_EXCEPTION"/>
<Bug pattern="US_USELESS_SUPPRESSION_ON_METHOD"/>
<Bug pattern="US_USELESS_SUPPRESSION_ON_CLASS"/>
<Bug pattern="US_USELESS_SUPPRESSION_ON_FIELD"/>
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
<Bug pattern="SS_SHOULD_BE_STATIC"/>
<Bug pattern="NP_UNWRITTEN_FIELD"/>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR"/>
<Bug pattern="MS_EXPOSE_REP"/>
Comment on lines +11 to +26

@PDavid PDavid May 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this suppression list are very broad. They are including real concurrency bugs (AT_STALE_THREAD_WRITE_OF_PRIMITIVE, AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE) and design issues (CT_CONSTRUCTOR_THROW, EI_EXPOSE_REP). Should we create a follow-up Jira to triage
and fix these incrementally?

Or should we suppress these by class so that these are not suppressed everywhere? We have 198 class/pattern combinations across these 16 patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


</FindBugsFilter>

58 changes: 34 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,6 @@
<name>m2e.version</name>
</property>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -436,15 +433,6 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>jdk-release-flag</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
</profile>
<profile>
<id>clover</id>
<activation>
Expand Down Expand Up @@ -540,8 +528,7 @@

<properties>
<!-- maven properties -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<project.build.outputTimestamp>1691130453</project.build.outputTimestamp>
<dependency.locations.enabled>false</dependency.locations.enabled>
<surefire.version>2.22.1</surefire.version>
Expand All @@ -556,7 +543,7 @@
<jmockit.version>1.48</jmockit.version>
<junit.version>5.6.2</junit.version>
<junit-platform.version>1.6.2</junit-platform.version>
<mockito.version>4.9.0</mockito.version>
<mockito.version>5.23.0</mockito.version>
<hamcrest.version>2.2</hamcrest.version>
<commons-cli.version>1.5.0</commons-cli.version>
<netty.version>4.1.130.Final</netty.version>
Expand All @@ -568,11 +555,11 @@
<bouncycastle.version>1.78</bouncycastle.version>
<commons-collections.version>4.4</commons-collections.version>
<dropwizard.version>4.1.12.1</dropwizard.version>
<spotbugsannotations.version>4.0.2</spotbugsannotations.version>
<spotbugsannotations.version>4.9.3</spotbugsannotations.version>
<checkstyle.version>8.39</checkstyle.version>
<enforcer.version>3.0.0-M3</enforcer.version>
<commons-io.version>2.17.0</commons-io.version>
<burningwave.mockdns.version>0.25.4</burningwave.mockdns.version>
<burningwave.mockdns.version>0.27.2</burningwave.mockdns.version>
<dnsjava.version>3.5.1</dnsjava.version>
<clover-maven-plugin.version>4.4.1</clover-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
Expand Down Expand Up @@ -704,12 +691,6 @@
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
Expand Down Expand Up @@ -887,10 +868,39 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.0.0</version>
<version>4.9.3.0</version>
<configuration>
<excludeFilterFile>excludeFindBugsFilter.xml</excludeFilterFile>
</configuration>
<dependencies>
<!-- Override ASM version to support JDK 25 (class file version 69)
TODO: Remove this override when future SpotBugs version bundles ASM 9.9+ -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-analysis</artifactId>
<version>9.9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>9.9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>9.9.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>9.9.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.KeyStore;
Expand Down Expand Up @@ -107,8 +108,10 @@ public void testInvalidAddr() throws MetricsProviderLifeCycleException {
assertThrows(MetricsProviderLifeCycleException.class, provider::start);

assertEquals("Failed to start Prometheus Jetty server", exception.getMessage());
assertNotNull(exception.getCause());
assertEquals("Failed to bind to master:0", exception.getCause().getMessage());
Throwable cause = exception.getCause();
assertNotNull(cause);
assertTrue(cause.getMessage().contains("Failed to bind to master"));
assertTrue(cause.getMessage().contains(":0"));
}

@Test
Expand Down
5 changes: 0 additions & 5 deletions zookeeper-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.zookeeper.server.ServerConfig;
import org.apache.zookeeper.server.ServerMetrics;
import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
Expand Down Expand Up @@ -64,9 +65,9 @@ public class JvmPauseMonitor {
public static final String INFO_THRESHOLD_KEY = "jvm.pause.info-threshold.ms";
public static final long INFO_THRESHOLD_DEFAULT = 1000;

private volatile long numGcWarnThresholdExceeded = 0;
private volatile long numGcInfoThresholdExceeded = 0;
private volatile long totalGcExtraSleepTime = 0;
private final AtomicLong numGcWarnThresholdExceeded = new AtomicLong(0);
private final AtomicLong numGcInfoThresholdExceeded = new AtomicLong(0);
private final AtomicLong totalGcExtraSleepTime = new AtomicLong(0);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: These were needed to fix the spotbugs issue:

[ERROR] High: Increment of volatile field org.apache.zookeeper.server.util.JvmPauseMonitor.numGcInfoThresholdExceeded in org.apache.zookeeper.server.util.JvmPauseMonitor$JVMMonitor.run() [org.apache.zookeeper.server.util.JvmPauseMonitor$JVMMonitor] At JvmPauseMonitor.java:[line 203] VO_VOLATILE_INCREMENT
[ERROR] High: Increment of volatile field org.apache.zookeeper.server.util.JvmPauseMonitor.numGcWarnThresholdExceeded in org.apache.zookeeper.server.util.JvmPauseMonitor$JVMMonitor.run() [org.apache.zookeeper.server.util.JvmPauseMonitor$JVMMonitor] At JvmPauseMonitor.java:[line 200] VO_VOLATILE_INCREMENT


private Thread monitorThread;
private volatile boolean shouldRun = true;
Expand Down Expand Up @@ -106,15 +107,15 @@ public boolean isStarted() {
}

public long getNumGcWarnThresholdExceeded() {
return numGcWarnThresholdExceeded;
return numGcWarnThresholdExceeded.get();
}

public long getNumGcInfoThresholdExceeded() {
return numGcInfoThresholdExceeded;
return numGcInfoThresholdExceeded.get();
}

public long getTotalGcExtraSleepTime() {
return totalGcExtraSleepTime;
return totalGcExtraSleepTime.get();
}

private String formatMessage(long extraSleepTime, Map<String, GcTimes> gcTimesAfterSleep, Map<String, GcTimes> gcTimesBeforeSleep) {
Expand All @@ -133,8 +134,8 @@ private String formatMessage(long extraSleepTime, Map<String, GcTimes> gcTimesAf
String ret = String.format("Detected pause in JVM or host machine (eg GC): pause of approximately %d ms, "
+ "total pause: info level: %d, warn level: %d %n",
extraSleepTime,
numGcInfoThresholdExceeded,
numGcWarnThresholdExceeded);
numGcInfoThresholdExceeded.get(),
numGcWarnThresholdExceeded.get());
if (gcDiffs.isEmpty()) {
ret += ("No GCs detected");
} else {
Expand Down Expand Up @@ -197,13 +198,13 @@ public void run() {
}
Map<String, GcTimes> gcTimesAfterSleep = getGcTimes();
if (extraSleepTime > warnThresholdMs) {
++numGcWarnThresholdExceeded;
numGcWarnThresholdExceeded.incrementAndGet();
LOG.warn(formatMessage(extraSleepTime, gcTimesAfterSleep, gcTimesBeforeSleep));
} else if (extraSleepTime > infoThresholdMs) {
++numGcInfoThresholdExceeded;
numGcInfoThresholdExceeded.incrementAndGet();
LOG.info(formatMessage(extraSleepTime, gcTimesAfterSleep, gcTimesBeforeSleep));
}
totalGcExtraSleepTime += extraSleepTime;
totalGcExtraSleepTime.addAndGet(extraSleepTime);
gcTimesBeforeSleep = gcTimesAfterSleep;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1390,11 +1390,7 @@ server if this feature is enabled with sasl as authentication scheme.
## TLS Cipher Suites

From 3.5.5 to 3.9 a hard coded default cipher list was used, with the ordering
dependent on whether it is run Java 8 or a later version.

The list on Java 8 includes TLSv1.2 CBC, GCM and TLSv1.3 ciphers in ordering: _TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256_

The list on Java 9+ includes TLSv1.2 GCM, CBC and TLSv1.3 ciphers in ordering: _TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256_
dependent on whether it was run Java 8 or a later version.

Since 3.10 there is no hardcoded list, and the JDK defaults are used.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ is no full support.

### Required Software

ZooKeeper runs in Java, release 1.8 or greater
(JDK 8 LTS, JDK 11 LTS, JDK 12 - Java 9 and 10 are not supported).
ZooKeeper runs in Java, release 17 or greater
(JDK 17 LTS, JDK 21 LTS, JDK 25 LTS - other Java versions are not supported).
It runs as an _ensemble_ of ZooKeeper servers. Three
ZooKeeper servers is the minimum recommended size for an
ensemble, and we also recommend that they run on separate
Expand Down
Loading