elephone-184 opened a new pull request, #4970:
URL: https://github.com/apache/rocketmq-dashboard/pull/4970
## What is the purpose of the change
In production, consumer clients periodically encounter consumption stalls
and hang scenarios caused by business listener deadlocks, I/O timeouts, or
client-side flow control backpressure. Operators currently have to manually
trigger a raw jstack and cross-reference queue progress to guess why
consumption is not advancing.
This PR introduces an automated `ConsumerHangDiagnosticEngine` that parses
live `ConsumerRunningInfo`:
1. `ConsumerHangReportVO` & `QueueHangFindingVO`: Structured diagnostics
capturing stall durations, cached message volume, and queue-level findings.
2. `ConsumerHangDiagnosticEngine`: Analyzes `ProcessQueueInfo` timestamps
(`lastConsumeTimestamp`, `lastPullTimestamp`) against real thresholds (30s
warning, 120s critical), correlates with thread states from client `jstack`,
and classifies root causes (`BUSINESS_LISTENER_BLOCKED`, `PULL_FLOW_CONTROL`,
`CLIENT_DROPPED_QUEUE`).
3. Provider & Controller integration: Connects through
`RocketMQConsumerDiagnosticsProvider` and exposes
`/api/groups/{name}/instances/{clientId}/hang-diagnostics` in
`ConsumerGroupController`.
4. Comprehensive unit test suite covering stalled states, healthy
consumption, flow control, and controller/service integration.
## Brief changelog
- Add `ConsumerHangReportVO.java` domain model.
- Add `ConsumerHangDiagnosticEngine.java` diagnostic analysis logic.
- Add `diagnoseConsumerHang` method in `ConsumerDiagnosticsProvider` and
`ConsumerDiagnosticsService`.
- Expose `/api/groups/{name}/instances/{clientId}/hang-diagnostics` in
`ConsumerGroupController`.
- Add `ConsumerHangDiagnosticEngineTest.java` and tests in
`ConsumerDiagnosticsServiceTest.java` and `ConsumerGroupControllerTest.java`.
## Verifying this change
- `ConsumerHangDiagnosticEngineTest`: verifies healthy, blocked listener,
flow control, and dropped queue detection.
- `ConsumerDiagnosticsServiceTest`: verifies diagnostic delegation to
provider.
- `ConsumerGroupControllerTest`: verifies
`/api/groups/{name}/instances/{clientId}/hang-diagnostics` endpoint
serialization.
--
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]