wang-jiahua opened a new pull request, #3041: URL: https://github.com/apache/rocketmq-dashboard/pull/3041
### Which Issue(s) This PR Fixes Fixes #3040 ### Brief Description `fetchBrokerRuntimeStats` retried on failure but discarded the retry's return value and unconditionally rethrew the original exception, so a successful retry changed nothing — the retries only added sleep. The catch block now propagates the retry result (`return fetchBrokerRuntimeStats(brokerAddr, retryTime - 1);`). When retries are exhausted the method already returns null (`retryTime == 0`), which the caller `collectBroker` already handles via `if (kvTable == null) continue`. The existing `testCollectBroker` was itself evidence of the bug: it stubs the fetch to "throw once, then succeed" yet asserted that `collectBroker` throws. It has been updated to the fixed semantics (persistent failure → skip that broker without throwing), and a new test covers the transient-failure-then-success path. ### How Did You Test This Change? - New deterministic test `testCollectBrokerRetriesFetchBrokerRuntimeStatsOnTransientFailure`: fails on the unfixed code with `RuntimeException: fetchBrokerRuntimeStats exception`, passes with the fix and asserts one collected entry. - `DashboardCollectTaskTest` 3/3 pass on current master (JDK 17). -- 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]
