-
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
Changes from 16 commits
88cd989
077fbdd
e0684de
a07e58e
3c3df59
0a74e3b
9a95d36
9cad6d5
58762dd
891909c
a6dff1e
6a61f35
56f47a7
859ba6f
e49e12c
21a1c02
ccb70d7
53e4717
3958476
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 |
|---|---|---|
| @@ -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. |
| 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.
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. Created https://issues.apache.org/jira/browse/ZOOKEEPER-5079 for this. |
||
|
|
||
| </FindBugsFilter> | ||
|
|
||
| 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; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.