From 840636b0e2718f8560c749a2bd5943cbbd467d36 Mon Sep 17 00:00:00 2001 From: "daniel.solis" Date: Tue, 11 Aug 2026 10:24:08 -0600 Subject: [PATCH] docs(clustering): correct the stale server-heartbeat interval comment SERVER_HEARTBEAT_RUN_EVERY_SECONDS defaults to 60, but the trailing comment read "runs every 5 seconds." The comment was wrong from the moment it was written, not left behind by a later change of default. Commit 999036092e (#19291, unifying the three quartz schedulers) introduced this block by adapting the SystemEventsJob block ~150 lines above, which does default to 5 seconds and carries that exact comment; the property name and default were changed to 60 and the comment was not. The cadence itself never changed either. Before that commit the heartbeat was a Quartz CronTrigger on HEARTBEAT_CRON_EXPRESSION, defaulted to "0 0/1 * * * ?" in dotcms-config-cluster.properties -- once a minute. The 60-second fixed delay preserved it. Replaced with a note on what the interval actually governs, since it bounds how quickly a node notices a membership change or retries a failed cache-transport rewire (#36803). Comment only; no behaviour change. --- .../main/java/com/dotmarketing/init/DotInitScheduler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java b/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java index f2c8d25f6639..e06083ff1043 100644 --- a/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java +++ b/dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java @@ -581,8 +581,11 @@ private static void addTelemetryMetricsStatsJob(final Scheduler scheduler) { private static void addServerHeartbeatJob () { final int initialDelay = Config.getIntProperty("SERVER_HEARTBEAT_INITIAL_DELAY_SECONDS", 60); - final int delaySeconds = Config.getIntProperty("SERVER_HEARTBEAT_RUN_EVERY_SECONDS", 60); // runs every 5 seconds. - + // Both default to one minute, matching the HEARTBEAT_CRON_EXPRESSION (0 0/1 * * * ?) this + // replaced when the schedulers were unified. The cadence bounds how quickly a node notices + // a cluster membership change or retries a failed cache-transport rewire. + final int delaySeconds = Config.getIntProperty("SERVER_HEARTBEAT_RUN_EVERY_SECONDS", 60); + DotConcurrentFactory.getScheduledThreadPoolExecutor().scheduleAtFixedRate(() -> { Try.run(() -> new ServerHeartbeatJob().execute(null)).onFailure(e->Logger.warnAndDebug(DotInitScheduler.class, e)); }, initialDelay, delaySeconds, TimeUnit.SECONDS);