Frun1na opened a new pull request, #6096:
URL: https://github.com/apache/rocketmq-dashboard/pull/6096

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6095
   
   ### Brief Description
   
   `RocketMQClusterProvider.discoverProxiesViaHeartbeatSyncer`
   (`provider/apache/RocketMQClusterProvider.java:396-400`) caught every 
exception from the heartbeat-syncer read
   and returned an empty Proxy list — the same answer a cluster without any 
Proxy gives. An unreachable broker or
   NameServer was therefore reported as "this cluster runs no Proxy"; the 
instance path turns it into
   `404 Proxy not found in instance …` through 
`ProxyAddressService.requireInstanceProxy`, and the `rmq.proxy.list`
   tool reports an empty inventory.
   
   The read is now graded the way the repository already grades it everywhere 
else:
   `CONSUMER_NOT_ONLINE` / `TOPIC_NOT_EXIST` (a cluster that currently runs no 
Proxy) keeps returning an empty
   list, and anything else is a `502` naming the underlying cause.
   `ProxyConsumerResolver.discoverProxyAddressesStatus` applies exactly this 
grading to the same admin call, and
   `discoverClustersAt` / `refreshClusterDetail` in the same class throw `502` 
when their admin call fails.
   
   User-visible change: a Proxy inventory requested while the cluster cannot be 
reached answers `502` with the
   cause instead of `200` with an empty list; a cluster that genuinely has no 
Proxy is unchanged.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test -DforkCount=1 
-Dsurefire.failIfNoSpecifiedTests=false -Dtest=RocketMQClusterProviderTest
   [INFO] --- checkstyle:3.6.0:check (validate) @ rocketmq-studio ---
   [INFO] Tests run: 20, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   ```
   
   The new failure case fails without the fix, with only the product file 
reverted:
   
   ```
   [ERROR] Tests run: 20, Failures: 1, Errors: 0, Skipped: 0
   discoverProxiesShouldReportAHeartbeatSyncerReadFailureTest -- <<< FAILURE!
   java.lang.AssertionError:
   Expecting code to raise a throwable.
        at 
...RocketMQClusterProviderTest.discoverProxiesShouldReportAHeartbeatSyncerReadFailureTest(RocketMQClusterProviderTest.java:327)
   ```
   
   `discoverProxiesShouldReportAnAbsentHeartbeatSyncerGroupAsEmptyTest` pins 
the empty business result for an
   absent group, so the grading cannot regress into "every failure is an error".
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


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