You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hertzbeat.apache.org by "orangeCatDeveloper (via GitHub)" <gi...@apache.org> on 2026/08/09 10:18:22 UTC
[PR] [fix] keep zero-row metrics data in redis queue codec [hertzbeat]
orangeCatDeveloper opened a new pull request, #4305:
URL: https://github.com/apache/hertzbeat/pull/4305
## What's changed?
Fixes #3457.
With the Redis data queue enabled, a monitor whose target goes offline never turns DOWN. The collector does report the failure: it emits a `MetricsData` with zero rows whose code (`TIMEOUT`/`FAIL`), monitor id and priority all live in the Arrow schema metadata. But `RedisMetricsDataCodec.decodeValue` treated `rowCount == 0` as an empty message and dropped it, so `DataStorageDispatch.calculateMonitorStatus` never saw the failure and the monitor stayed UP forever. The in-memory and Kafka queues do not filter zero-row data, so only Redis deployments were affected.
This change stops discarding zero-row messages and instead rejects only streams that contain no record batch at all (`loadNextBatch()` returning false), which our encoder never produces. Downstream is safe: history and realtime writers already reject non-SUCCESS data, so failure messages only drive status/alerting.
Verified end-to-end with a Redis-queue deployment (app + redis + nginx target in docker): before the fix the monitor stays UP forever after the target is stopped; with the fix it flips to DOWN within one collect cycle.
## Checklist
- [x] I have read the [Contributing Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
- [x] I have written the necessary doc or comment.
- [x] I have added the necessary unit tests and all cases have passed.
## Add or update API
- [ ] I have added the necessary [e2e tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org
Re: [PR] [fix] keep zero-row metrics data in redis queue codec [hertzbeat]
Posted by "Duansg (via GitHub)" <gi...@apache.org>.
Duansg merged PR #4305:
URL: https://github.com/apache/hertzbeat/pull/4305
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@hertzbeat.apache.org
For additional commands, e-mail: notifications-help@hertzbeat.apache.org