Skip to content

fix(collector): fail closed on disk, archiver, and sequence gaps - #1155

Open
proerror77 wants to merge 3 commits into
mainfrom
cursor/collector-health-fail-closed-1729
Open

proerror77 wants to merge 3 commits into
mainfrom
cursor/collector-health-fail-closed-1729

Conversation

@proerror77

@proerror77 proerror77 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Change

Collector host health now fails closed when disk capacity is unobservable, a production LOB archiver is dead, health.json is missing/stale/unparseable/malformed, or LOB sequence gaps grow. Those used to be warnings, so ok:true could still hold while the monitor that exists to catch silent collector death could not see disk, process, or replay liveness.

Sequence-gap increases stay latched on the local five-minute timer (MONDAY_COLLECTOR_HEALTH_LATCH_SEQUENCE_GAPS=1) so the 15-minute GitHub monitor-collector-host poll still observes the breach. The alerting poll then consumes the new baseline. Malformed updated_at_ns is a breach, not a warning.

Non-LOB unit/timer Result, restart-rate deltas, and sequence session/regression rebaselines stay warnings. Failed recovery jobs still require an identity-bearing resume; this change does not auto-resume them.

Issue relationship

None

Validation

git diff --check

deployment/aliyun/test-monday-collector-health.sh — contract assertions cover df unavailable, archiver inactive/failed Result, missing/symlink/stale/malformed health.json, current sequence_gaps, sequence_gap_total increase, and timer-latch until a non-latch (GitHub) poll consumes the counter.

Runtime impact and rollback

Monitor-only. After merge the next collector-health deploy of monday-collector-health.sh and monday-collector-health.service will start paging on these breaches and will latch sequence-gap deltas on the host timer. Rollback is reverting this commit / restoring the previous installed script and unit. No automatic artifact publication beyond ordinary merge-triggered publication.

Open in Web Open in Cursor 

@proerror77
proerror77 marked this pull request as ready for review September 12, 2026 04:42
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9637acd7-5610-4865-867f-58a829a5df0d


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-12T04:49:39.507399Z f9c302f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9c302f996

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

sequence_gap_delta_json=$sequence_gap_delta
sequence_gap_baseline=increased
record_warning "$label: sequence_gap_total increased $prior_total -> $sequence_gap_total (delta=$sequence_gap_delta)"
record_breach "$label: sequence_gap_total increased $prior_total -> $sequence_gap_total (delta=$sequence_gap_delta)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve sequence-gap deltas until the alerting poll

monday-collector-health.timer runs this stateful script every five minutes, while .github/workflows/monitor-collector-host.yml invokes it only every fifteen minutes. After the local timer observes this newly promoted breach, the same invocation writes the increased counter as the new baseline at line 775; the next local run and the GitHub alerting run therefore see a stable counter, return ok:true, and never open the triage issue. Keep the gap latched (or otherwise expose it to the alerting channel) instead of consuming it on the first non-alerting poll.

AGENTS.md reference: AGENTS.md:L103-L104

Useful? React with 👍 / 👎.

Comment on lines +710 to +711
else
age=999999

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat malformed health timestamps as breaches

When health.json is valid JSON but updated_at_ns is a string, object, or otherwise non-numeric, this new branch sets an artificial age and continues; the later existing path records only a warning, so the monitor returns ok:true even though LOB health freshness is unverifiable. This also changes the prior arithmetic failure—which the workflow surfaced as a monitor-invocation alert—into a silent non-blocking result. Record a breach in this branch so malformed timestamps fail closed like missing, unparseable, and stale health files.

AGENTS.md reference: AGENTS.md:L103-L104

Useful? React with 👍 / 👎.

@cursor
cursor Bot force-pushed the cursor/collector-health-fail-closed-1729 branch from 4d4e5ee to 72fed78 Compare September 12, 2026 05:09
cursoragent and others added 3 commits September 12, 2026 05:44
Promote df failure, production LOB archiver death, missing or stale
health.json, and sequence-gap growth from warnings to hard breaches so
the host monitor cannot report ok while those observability gates fail.

Co-authored-by: Wild Card <proerror77@users.noreply.github.com>
Keep sequence_gap_total increases latched on the local five-minute timer so
the 15-minute monitor-collector-host poll still observes the breach. Treat
malformed health.json updated_at_ns as a liveness breach.

Co-authored-by: Wild Card <proerror77@users.noreply.github.com>
JSON mode writes breaches in the snapshot object, not as `breach:` stdout lines.

Co-authored-by: Wild Card <proerror77@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/collector-health-fail-closed-1729 branch from 72fed78 to e3ccab8 Compare September 12, 2026 05:44
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