wang-jiahua opened a new issue, #3040:
URL: https://github.com/apache/rocketmq-dashboard/issues/3040

   ### Describe the Bug
   
   `DashboardCollectTask.fetchBrokerRuntimeStats(brokerAddr, retryTime)` 
retries on failure, but the retry is ineffective: the catch block calls 
`fetchBrokerRuntimeStats(brokerAddr, retryTime - 1)` **discarding the return 
value**, then unconditionally rethrows the original exception. Even when a 
retry succeeds, its result is thrown away and the caller still sees the 
original failure — the retries only add sleep time.
   
   The existing test actually documents the broken behavior: 
`DashboardCollectTaskTest.testCollectBroker` stubs the fetch to "throw once, 
then return a kvTable" (clearly intending to exercise a successful retry), yet 
asserts that `collectBroker` throws.
   
   ### Steps to Reproduce
   
   Stub `fetchBrokerRuntimeStats` to fail once then succeed (as the existing 
test does); `collectBroker` still fails with `RuntimeException: 
fetchBrokerRuntimeStats exception`.
   
   ### What Did You Expect to See?
   
   A transient failure is absorbed by the retry and the collected stats are 
returned.
   
   ### What Did You See Instead?
   
   The retry result is discarded and the original exception is rethrown 
unconditionally.
   
   ### Additional Context
   
   Fix incoming: `return fetchBrokerRuntimeStats(brokerAddr, retryTime - 1);` 
in the catch block. When retries are exhausted the method already returns null 
at `retryTime == 0`, and the caller `collectBroker` already handles it with `if 
(kvTable == null) continue`.
   


-- 
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]

Reply via email to