dotCMS / dotCMS/core

Fix ElasticsearchHealthCheck event-driven integration and rename to SearchHealthCheck

Open
#33,244 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority : 2 High Team : Platform
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

The ElasticsearchHealthCheck is not properly integrated with the ElasticsearchHealthEventManager, causing both traditional and event-driven health checks to run simultaneously and call the expensive /_nodes/stats endpoint. This results in performance issues and frequent timeouts. Additionally, the component should be renamed to SearchHealthCheck to reflect the move to OpenSearch.

Problem

  1. ElasticsearchHealthCheck extends HealthCheckBase but does not override getEventManager() or supportsEventDriven()
  2. Both ElasticsearchHealthCheck and ElasticsearchHealthEventManager call getClusterStats() which hits /_nodes/stats
  3. Results in expensive endpoint being called every 30 seconds from traditional polling AND every 30 seconds from event-driven pings
  4. Component name should reflect OpenSearch transition

Root Cause

ElasticsearchHealthCheck is missing the required integration with ElasticsearchHealthEventManager:

  • Missing @Inject ElasticsearchHealthEventManager
  • Missing getEventManager() override
  • Missing supportsEventDriven() override

Solution

  1. Add proper event-driven integration to ElasticsearchHealthCheck
  2. Rename to SearchHealthCheck for OpenSearch compatibility
  3. Update related class names and references
  4. Consider using lightweight /_cluster/health endpoint instead of /_nodes/stats

Impact

  • Reduces expensive Elasticsearch calls from every 15s effectively to every 90s
  • Improves system performance under load
  • Aligns naming with OpenSearch transition

Acceptance Criteria

  • [Define what needs to be accomplished]

Additional Notes

[Any additional context or notes]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating ElasticsearchHealthCheck, ElasticsearchHealthEventManager, and HealthCheckBase, then trace how getClusterStats() is invoked by polling and event-driven checks. Done means the health check is integrated with the event manager, duplicate expensive calls are avoided, related references use SearchHealthCheck, and the endpoint choice is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.