-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ZOOKEEPER-5039: Raise to min JDK 17, also build, test with JDK25 #2376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6869ef7
26eb93d
5f06a01
96dd2e4
0206576
60bdc44
0cf2cf1
94e3347
3fcade2
cded82a
45bdbda
f411e70
88564d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ pipeline { | |
|
|
||
| tools { | ||
| maven "maven_latest" | ||
| jdk "jdk_1.8_latest" | ||
| jdk "jdk_17_latest" | ||
| } | ||
|
|
||
| stages { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| # under the License. | ||
| # | ||
|
|
||
| FROM maven:3.8.4-jdk-11 | ||
| FROM maven:3.8.8-eclipse-temurin-17 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GPG command is still missing from the container. |
||
|
|
||
| RUN apt-get update | ||
| RUN apt-get install -y \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Or should we suppress these by class so that these are not suppressed everywhere? We have 198 class/pattern combinations across these 16 patterns. |
||
|
|
||
| </FindBugsFilter> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,8 +125,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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we define which ZooKeeper versions drop JDK8/11 support?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, good question. 👍 I guess the current master (3.10.x) drops the JDK8/11 support for sure. @anmolnar wrote this on the dev list:
See: https://lists.apache.org/thread/xrd4ct4lv6hqd7mb2dqtx8v1nkzy7kjq So I guess only 3.10.x drops JDK8/11 support then. 🤔 Do you all think I get it right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct. Java 17 supposed to be the minimum required runtime and compile version for 3.10.x (or whatever version is going to be cut from master). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anmolnar what's the criteria for a major version? Is dropping support for older JDKs something that users might expect to be in a 4.x release? (It doesn't affect me as all my infra is ready for this change already, I'm mostly curious)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember when JDK7 got dropped, it was also a minor version.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest rather discussing everything related to this change on the mailing list. It's probably going to be a 3.10.0 cut soon once this change is landed. |
||
| (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 | ||
|
|
@@ -1926,11 +1926,7 @@ and [SASL authentication for ZooKeeper](https://cwiki.apache.org/confluence/disp | |
| ##### 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. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: These were needed to fix the spotbugs issue: |
||
|
|
||
| private Thread monitorThread; | ||
| private volatile boolean shouldRun = true; | ||
|
|
@@ -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) { | ||
|
|
@@ -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 { | ||
|
|
@@ -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; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update these to 3.7.x, 3.8.x, 3.9.x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I guess it would make sense to have here the stable 3.8.x and current 3.9.x versions.
3.7 is EoL since 2nd of February, 2024.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about this @anmolnar? I did not updated this yet. Should I?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does that setting mean?