Skip to content

fix(deployment): Switch webui health checks from TCP to HTTP to detect OOM-thrashing Node.js (fixes #2172).#2186

Merged
junhaoliao merged 3 commits into
y-scope:mainfrom
junhaoliao:webui-detect-heath
Apr 8, 2026
Merged

fix(deployment): Switch webui health checks from TCP to HTTP to detect OOM-thrashing Node.js (fixes #2172).#2186
junhaoliao merged 3 commits into
y-scope:mainfrom
junhaoliao:webui-detect-heath

Conversation

@junhaoliao

@junhaoliao junhaoliao commented Apr 8, 2026

Copy link
Copy Markdown
Member

Description

The webui container's health checks (Docker Compose and Helm) only test TCP port connectivity (< /dev/tcp/webui/4000 / tcpSocket), which continues to pass even when the Node.js process is OOM-thrashing and unable to serve HTTP requests. This leaves the container in a permanently degraded state that is never detected or restarted.

This PR switches both configurations to use HTTP-based health checks (curl -f in Compose, httpGet in Helm) against the webui root path (/), consistent with how the api-server, mcp-server, and log-ingestor services are already health-checked. Since curl is already recently installed
in the clp-package image, no image changes are required.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Scenario 1: Verify curl is available in the clp-package image

Task: Confirm that curl is already installed in the container image so the Compose healthcheck
can use it without image changes.

Command:

docker run --rm --entrypoint="" \
  $(cat build/clp-package-image.id) \
  which curl

Output:

/usr/bin/curl

Scenario 2: Start CLP and verify webui becomes healthy with HTTP health check

Task: Deploy the CLP package with the updated Compose file and confirm the webui container
reaches healthy status using the new HTTP-based health check.

Command:

cd build/clp-package
./sbin/start-clp.sh

Output:

 Container clp-package-8164-webui-1 Created
...
 Container clp-package-8164-webui-1 Healthy
2026-04-04T09:27:03.924 INFO [controller] Started CLP.

Explanation: The webui container passes the new HTTP health check and reaches healthy status.

Scenario 3: Inspect webui container health check details

Task: Verify the health check is actually using HTTP (curl) and returning a successful response.

Command:

docker inspect clp-package-8164-webui-1 --format='{{json .State.Health}}' | python3 -m json.tool

Output:

{
    "Status": "healthy",
    "FailingStreak": 0,
    "Log": [
        {
            "Start": "2026-04-04T05:27:03.263562725-04:00",
            "End": "2026-04-04T05:27:03.298101702-04:00",
            "ExitCode": 0,
            "Output": "...<!doctype html>\n<html lang=\"en\">\n<head>\n    <title>YScope CLP</title>..."
        }
    ]
}

Explanation: The health check log shows curl successfully retrieved the HTML page from /
with exit code 0, confirming the HTTP-level check works correctly.

Scenario 4: Verify HTTP endpoint responds with 200

Task: Confirm the webui root path returns HTTP 200, which is the response code curl -f
requires to pass.

Command:

curl -f --max-time 2 http://localhost:4000/ -o /dev/null -w "HTTP %{http_code}\n"

Output:

HTTP 200

Scenario 5: End-to-end compression test

Task: Verify the overall CLP package still functions correctly with the updated health check.

Command:

cd build/clp-package
./sbin/compress.sh --timestamp-key timestamp ~/samples/postgresql.jsonl

Output:

2026-04-04T09:27:19.302 INFO [compress] Compression job 4 submitted.
2026-04-04T09:27:21.306 INFO [compress] Compressed 385.21MB into 10.06MB (38.31x). Speed: 197.98MB/s.
2026-04-04T09:27:21.807 INFO [compress] Compression finished.
2026-04-04T09:27:21.807 INFO [compress] Compressed 385.21MB into 10.06MB (38.31x). Speed: 179.03MB/s.

Explanation: Compression succeeds end-to-end, confirming no regression from the health check
change.

Summary by CodeRabbit

  • Chores
    • Switched health checks from TCP/port probes to HTTP endpoint checks across deployments and compose setups to better reflect service readiness and responsiveness.
    • Bumped the Helm chart package version to indicate the deployment config update.

@junhaoliao junhaoliao requested a review from a team as a code owner April 8, 2026 13:27
@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e891df1c-14e4-4292-ad39-0bb0899343ea

📥 Commits

Reviewing files that changed from the base of the PR and between 12d188c and ca6b37e.

📒 Files selected for processing (1)
  • tools/deployment/package-helm/Chart.yaml

Walkthrough

Switched webui health probes from TCP socket checks to HTTP GET checks in both Helm and Docker Compose deployments; updated Helm chart version.

Changes

Cohort / File(s) Summary
WebUI Health Check Updates
tools/deployment/package-helm/templates/webui-deployment.yaml, tools/deployment/package/docker-compose-all.yaml
Replaced TCP-based health probes with HTTP httpGet probes in Helm (readiness and liveness) and replaced bash TCP check with curl-based HTTP healthcheck in Docker Compose.
Chart Version Bump
tools/deployment/package-helm/Chart.yaml
Incremented Helm chart version from 0.2.1-dev.5 to 0.2.1-dev.6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: switching webui health checks from TCP to HTTP to detect OOM-thrashing Node.js processes, which directly matches the core objective and file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@junhaoliao junhaoliao requested a review from hoophalab April 8, 2026 14:27
hoophalab

This comment was marked as duplicate.

@hoophalab hoophalab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@junhaoliao junhaoliao merged commit 1e1329d into y-scope:main Apr 8, 2026
23 checks passed
@junhaoliao junhaoliao added this to the March 2026 milestone Apr 24, 2026
@junhaoliao junhaoliao deleted the webui-detect-heath branch May 7, 2026 19:46
junhaoliao added a commit to junhaoliao/clp that referenced this pull request May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants