The GitHub Actions job "Build and Run Tests by Bazel" on 
rocketmq.git/fix/query-consume-time-span-empty-queue has failed.
Run started by GitHub user zjncs (triggered by zjncs).

Head commit for run:
9c756b69038c86caa1d22aa3ff0fe46f4d9ca10a / zjncs <[email protected]>
[ISSUE #D10] Report zero timestamps in queryConsumeTimeSpan for empty queues

queryConsumeTimeSpan asks the store for the timestamp of offset max - 1
without checking the queue is non-empty, so an empty queue (max == 0)
queries offset -1 and the store answers -1: maxTimeStamp is reported as
-1, which admin clients render as an epoch timestamp. The delayTime
path has the same problem one step further: queryOffset returns -1 for
a group that never committed, -1 < maxBrokerOffset holds even for an
empty queue, and delayTime becomes now - (-1), i.e. current epoch
milliseconds. getTopicStatsInfo already guards the identical lookup
with if (max > 0).

Guard both lookups so an empty queue / never-committed group reports 0
instead of epoch-based garbage.

Signed-off-by: zjncs <[email protected]>

Report URL: https://github.com/apache/rocketmq/actions/runs/34466845608

With regards,
GitHub Actions via GitBox

Reply via email to