Skip to content

Correct the stale server-heartbeat interval comment in DotInitScheduler #37015

Description

@dsolistorres

Description

In dotCMS/src/main/java/com/dotmarketing/init/DotInitScheduler.java, inside addServerHeartbeatJob() (line ~584), the trailing comment on the server-heartbeat interval contradicts the value it annotates:

final int delaySeconds = Config.getIntProperty("SERVER_HEARTBEAT_RUN_EVERY_SECONDS", 60); // runs every 5 seconds.

The default is 60 seconds, not 5.

The comment was wrong when it was written — it is not a default that changed and left the comment behind. Commit 999036092e (#19291, unifying the 3 quartz schedulers, Oct 2020) created this block by adapting the SystemEventsJob block ~150 lines above in the same file:

final int delaySeconds = Config.getIntProperty("SYSTEM_EVENTS_DELAY_SECONDS", 5); // runs every 5 seconds.

That one is accurate — it really does default to 5. The heartbeat copy changed the property name and the default to 60 and kept the comment verbatim.

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 that; only the scheduling mechanism changed.

Why it is worth correcting: this interval bounds how quickly a node notices a cluster membership change and how quickly a failed cache-transport rewire is retried. A reader trusting the comment would be off by 12x when reasoning about cluster convergence or detection latency.

Found while tracing the heartbeat cadence for #36803 / #36864.

Acceptance Criteria

  • The stale // runs every 5 seconds. comment is removed from addServerHeartbeatJob().
  • The replacement comment states that both SERVER_HEARTBEAT_INITIAL_DELAY_SECONDS and SERVER_HEARTBEAT_RUN_EVERY_SECONDS default to one minute.
  • The replacement notes what the cadence governs — how quickly a node notices a cluster membership change or retries a failed cache-transport rewire.
  • No functional change: no property default, scheduling call, or behaviour is modified.
  • The correct // runs every 5 seconds. comment on SYSTEM_EVENTS_DELAY_SECONDS is left untouched.

Priority

Low

Additional Context

Comment-only change, already implemented in PR #37014. No behaviour change, no test impact, nothing for QA to verify — labelled QA : Not Needed. Needs only a quick review and merge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions