← Back to Pull requests

[fix] keep zero-row metrics data in redis queue codec #4305

Merged
orangeCatDeveloper merged 2 files (112 lines) on Aug 09, 2026 15:50 UTC
View on GitHub
orangeCatDeveloper orangeCatDeveloper commented on Aug 09, 2026 10:18 UTC
Author

What's changed?

Fixes #3457: with the Redis data queue enabled, a monitor whose target goes offline is never marked DOWN.

A failed/timed-out collect produces a MetricsData with zero rows — the failure info (monitor id, code, msg, priority) is carried in the Arrow schema metadata, and encodeValue always writes one record batch even for zero rows. On decode, however:

if (root == null || root.getRowCount() == 0) {
    return null;   // zero-row => silently dropped
}

so the failure never reaches DataStorageDispatch.calculateMonitorStatus. Only Redis is affected — the in-memory queue skips serialization and the Kafka path never filtered zero-row data.

Fix: keep zero-row messages; reject only schema-only streams (loadNextBatch() returns false). The root == null check is removed — getVectorSchemaRoot() never returns null, all its failures throw into the existing catch. Downstream writers already reject non-SUCCESS data, so failure messages drive only status and alerting.

Before/after E2E (redis-queue deployment in Docker, 10s interval, stop the nginx target):

| build | status after target dies |
|---|---|
| master | still UP after 180s, 17 × Empty data received in log |
| this PR | DOWN within ~30s |

Checklist

  • I have read the Contributing Guide

  • I have written the necessary doc or comment.

  • I have added the necessary unit tests and all cases have passed.
  • Add or update API

  • I have added the necessary e2e tests and all cases have passed.
  • Diff: 112 lines (+107 / -5) across 2 files Reviewer: Duansg Review duration: 332m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.33) × (1 − Review Confidence (0.48)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 112 lines diff across 2 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.00 · 1 substantive comment(s)
    0.00
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    48%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.350
    Diff Size diff_size
    0.283
    Real PR Conversation Timeline
    2 items
    Duansg Duansg approved these changes on Aug 09, 2026 15:03 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    orangeCatDeveloper orangeCatDeveloper
    Labels
    risk: low confidence: 48.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 32.7% (LOW) · Higher = larger blast radius
    32.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 48.5% · Lower = rushed or shallow review
    48.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%