[fix] keep zero-row metrics data in redis queue codec #4305
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.00 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Approved
Approved these changes.
Duansg
orangeCatDeveloper
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
MetricsDatawith zero rows — the failure info (monitor id,code,msg,priority) is carried in the Arrow schema metadata, andencodeValuealways writes one record batch even for zero rows. On decode, however: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()returnsfalse). Theroot == nullcheck 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 receivedin log || this PR | DOWN within ~30s |
Checklist
Add or update API