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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to